Here is some code which illustrates the issue: 1. The Component (File SystemMessage.mxml): <?xml version="1.0"
encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*"> <mx:Label id="TheMessage"/> </mx:Canvas> 2. The main application (File StatePlayground.mxml): <?xml version="1.0"
encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns:local="*"> <mx:Script> <![CDATA[ private function addLabel():Void { currentState="LabelAdded"; TheSystemMessage.TheMessage.text
= "I have been added"; } private function removeLabel():Void { currentState=""; } ]]> </mx:Script> <mx:Canvas width="100%" height="100%"> <mx:VBox> <mx:Button label="Add label"
click="addLabel()"/> <mx:Button label="Remove label"
click="removeLabel()"/> </mx:VBox> </mx:Canvas> <mx:states> <mx:State name="LabelAdded"> <mx:AddChild position="firstChild"> <local:SystemMessage id="TheSystemMessage"/> </mx:AddChild> </mx:State> </mx:states> </mx:Application> è Issue:
First click on “Add label” Buttonf fails with Erorr #1009: Null has
no properties. If you dismiss the error subsequent clicks work. Ralf -- 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] Part 2: Issues with State and Component creatio... Ralf Rottmann