Flex: Why can't I get sub-children of display object?

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

13.10.2009 20:09:12
1 ОТВЕТ
РЕШЕНИЕ

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

2
13.10.2009 22:48:20