私に近いコードを更新しました。何かが増分に間違っていますが、私はそれに私の指を置くことはできません。このコードをどのように関数に変換できますか? (Array to TextFields)
var myMovies:Array = ["Source Code", "Alice in Wonderland", "Zootopia", "Shrek", "Harry Potter"];
var inc:Number = 500; // starting vertical position
var increment:Number = 0;
function addField() {
var textBox:TextField = new TextField(); // assigns a variable to create a new text field
addChild(textBox); // adds the text field to the document
textBox.x = 150; // formats horizontal positioning
textBox.y = inc; // formats vertical positioning
inc-= 100; // subtracts 100px from vertical positioning
textBox.text = myMovies[increment];
increment++;// inserts array string into text box // goes to and stops on frame 2
}
if (increment < 5) {
addField();
} else {
gotoAndPlay(3);
}
テキストフィールドのレイアウトにはどのようなものを使用していますか?ポジショニングの問題のように聞こえる? – Michael
あなたは正しいと思います。上記のコードを修正して位置指定の書式設定を追加しました。 :)任意のヒントが高く評価されています。提案されているようにコードが動作しないようにするカウンタに何か問題があります。 – Lexii