'a' hasn't been created when you try to assign a value to 'text': <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" layout="absolute" creationComplete="init ()"> <mx:Script> <![CDATA[ internal var test:String = "foo"; internal function init () { a.text = test; } ]]> </mx:Script> <mx:TextArea x="45" y="50" width="662" height="477" id="a"/> </mx:Application>
-----Original Message----- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, February 27, 2006 4:43 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] strange undefined property error Below is the complete code. I've done a few test 'applications' with flex 2.0 in the last few weeks. When I decided to dig deeper into xml and flex however everything went weird. The following code gives an undefined property error on both 'a' and 'test'. I might be overlooking something obvious here, but as far as I can see the code is correct. What could cause this? Kind regards, Sonja Duijvesteijn <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" layout="absolute"> <mx:Script> <![CDATA[ var test:String = "foo"; a.text = test; ]]> </mx:Script> <mx:TextArea x="45" y="50" width="662" height="477" id="a"/> </mx:Application> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/