tags:

views:

143

answers:

1

Hello,

I am having problems accessing sub-children of my displayObject. Here is my code:private

function resizeTag(event:MouseEvent):void{
            var currTagPos:Number = 1; 
      var theTagBox:DisplayObject = tagCanvas.getChildAt(currTagPos); //i have confirmed that it exists on the stage and has sub-children

      trace(theTagBox.getChildAt(0).width);
     }

Essentially I'm trying to get:

tagCanvas.getChildAt(currTagPos).getChildAt(0).width;

but it's not working. Thanks for any guidance you can provide :)

+1  A: 

Looks like I needed to call it as a DisplayObjectContainer. I did this instead:

trace((tagCanvas.getChildByName(currTagName) as Canvas).getChildAt(3) as Button);

I found this post which helped me figure it out: http://www.nabble.com/undefined-method-getChildAt-td19812715.html

Aaron