Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex Flex:Why can';我不能得到显示对象的子对象吗?_Apache Flex - Fatal编程技术网

Apache flex Flex:Why can';我不能得到显示对象的子对象吗?

Apache flex Flex:Why can';我不能得到显示对象的子对象吗?,apache-flex,Apache Flex,我在访问displayObject的子项时遇到问题。这是我的密码:私人 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

我在访问displayObject的子项时遇到问题。这是我的密码:私人

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);
        }
基本上,我想得到:

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

但它不起作用。感谢您提供的指导:)

看起来我需要将其称为DisplayObjectContainer。我改为:

trace((tagCanvas.getChildByName(currTagName) as Canvas).getChildAt(3) as Button);
我找到了这篇文章,它帮助我找到了答案: