Suppose I have the following MXML declaration:

<mx:Canvas id="id0" x="37" y="41" >
<mx:Text x="25" y="10" text="Some Text" added="addLabel(this)" />
</mx:Canvas>

Notice in the "added" handler I use "this" hoping that the scope of
"this" is the actual Text element. My thinking is incorrect and the
debugger shows that "this" refers to the top level container (the one
defined in the same MXML page). So my question is: is there a way to
refer to that Text element *without* assigning an id to it. I assume
the following would work, but it is really not ideal for my use-case:

<mx:Canvas id="id0" x="37" y="41" >
<mx:Text id="myText" x="25" y="10" text="Some Text"
added="addLabel(myText)" />
</mx:Canvas>

Thanks,
Mark





--
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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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/
 

Reply via email to