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
Actionscript 3 如何在同一mxml中从一个脚本访问另一个脚本的函数_Actionscript 3_Apache Flex - Fatal编程技术网

Actionscript 3 如何在同一mxml中从一个脚本访问另一个脚本的函数

Actionscript 3 如何在同一mxml中从一个脚本访问另一个脚本的函数,actionscript-3,apache-flex,Actionscript 3,Apache Flex,这是my.mxml中的一个脚本 <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; public function __changeSel():void{ } ]]> </fx:Script> 同一my.mxml中组件标记中的另一个脚本 <fx:Component>

这是my.mxml中的一个脚本

  <fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        public function __changeSel():void{

        }
    ]]>
  </fx:Script>

同一my.mxml中组件标记中的另一个脚本

<fx:Component>
                                        <s:ComboBox change="changeSel(event)">  
                                            <s:id>selID</s:id>
                                            <s:dataProvider>
                                                    <s:ArrayCollection>
                                                        <fx:String>Less Than</fx:String>
                                                    </s:ArrayCollection>                                                    
                                            </s:dataProvider>
                                            <fx:Script>
                                                <![CDATA[
                                                    public function changeSel(even:Event):void{
                                                         __changeSel();
                                                    }
                                                ]]>
                                            </fx:Script>
                                        </s:ComboBox>
                                    </fx:Component>             

塞利德
少于

但是当我调用uu changeSel();它不能识别这个功能。有没有办法修复这个问题。

您不应该使用内联组件。这导致了范围的转移。编写一个适当的self-contains组件并在显示列表上分派事件,这样复合根目录就可以在冒泡事件上设置一个侦听器


否则,请尝试在内联呈现程序中使用outerDocument来调用该方法。

获得了解决方案。outerDocument。[objectname]并且它对我有效:)谢谢Florian。。。