Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将变量值输入文本字段?
var i:uint=0 for(i; i<4; i++){ pageText.text=i+1 }
如果我使用 i+"something" 那么它可以获得 i 值,但除此之外它无法获得 i 值。
TextField 的 text 属性需要一个字符串。使用 toString 转换 int。
var i:uint=0 for(i; i<4; i++){ pageText.text=i.toString(); }
尝试:
var pageText:TextField = new TextField(); var i:uint=0 this.addchild(pageText) for(i; i<4; i++) { pageText.text=i }