Error 1067: Can anyone point me to the problem?
i'm trying write take text user inputs , show in place
i have
import flash.text.textfield; import flash.events.textevent; stop(); // stop frame progressing // sourced , adapted adobe actionscript 3.0 files - capturing text input // http://help.adobe.com/en_us/actionscript/3.0_programmingas3/ws5b3ccc516d4fbf351e63e3d118a9b90204-7d8b.html // setting variables players name var playersnameinput:textfield = new textfield(); var playersnameoutput:textfield = new textfield(); // capture text input user function captureuserinput() { capturetext(); } function capturetext():void { playersnameinput.type = textfieldtype.input; addchild(playersnameinput); playersnameinput.addeventlistener(textevent.text_input, textinputcapture); } function textinputcapture(event:textevent):void { var playersnameoutput:string = playersnameinput.text; } // register enter key being pressed game can continue // intentionally blank @ time // output text entered user addchild(playersnameoutput); playersnameoutput.text = playersnameoutput;
when run it, i'm getting error code
1067: implicit coercion of value of type flash.text:textfield unrelated type string.
can please point me getting error , how might able fix please?
i have dynamic text box playersnameoutput instance name set on screen inputted text supposed display.
thanks
go publish settings , turn on permit debugging, line numbers errors. being said have:
var playersnameoutput:textfield = new textfield();
and then:
playersnameoutput.text = playersnameoutput;
playersnameoutput text field... not string. have inside function nothing:
function textinputcapture(event:textevent):void
{
var playersnameoutput:string = playersnameinput.text;
}
there, playersnameoutput local variable - not exist outside function. need use different variable names...
More discussions in ActionScript 3
adobe
Comments
Post a Comment