Use the argument passed to the event handler, that's what it's for.
currentTarget should give you what you need.

   private function init():void {
    var c1:Canvas = new Canvas();
    addChild(c1);
    
    var c2:Canvas = new Canvas();
    c1.addChild(c2);
    
    var c3:Canvas = new Canvas();
    c2.addChild(c3);
    
    var c4:Canvas = new Canvas();
    c3.addChild(c4);
    
    var ipt:TextInput = new TextInput();
    ipt.name = "test_input";
    ipt.id = "test_input";
    ipt.addEventListener(Event.ADDED_TO_STAGE,traceInput);
    c4.addChild(ipt);
   }
   
   private function traceInput(evt:Event):void {
    trace(evt.currentTarget); 
   }


----- Original Message ----- 
From: "Rafael Faria" <[EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>
Sent: Thursday, November 22, 2007 6:04 AM
Subject: [flexcoders] Re: Flex Hierarchy


I don't think i'm making myself clear.

The whole point is to get the "sbtButton" not the parent.

if you create sbtButton dinamically inside a <vbox><form><button>
(that will be dynamically as well)

"this.sbtButton" wouldnt work.

Let me try again



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