|
Hi List, I have a question about the initialisation rules for MXML components. My situation is as follows: I have defined a custom MXML component that extends the Canvas class (myComponent). MXML root node of the file, I put a Text element, assigning it an ID (myText). I define a setter method on this class (myProperty) that takes a String argument and passes it to myText.text. I use the custom component in the application, with a tag like this: <local:MyComponent myProperty="a value" /> Sure enough the instance is created and the setter method is called. However, an error results when I try to access the property of the child Text object. Apparently it has not been initialised when the method is called. This results in an error (setting a property on a null object). My question is if this is the expected behaviour and if there is a way to achieve this with MXML (setting properties of child objects from a setter method called at init time). Thanks for any insights. Cheers, Lach -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
__,_._,___ |
- [flexcoders] Initialization of MXML components Lachlan Cotter
- [flexcoders] Re: Initialization of MXML components Tim Hoff
- Re: [flexcoders] Initialization of MXML components Hilary Bridel
- RE: [flexcoders] Initialization of MXML components Gordon Smith

