Actionscript 3 如何在同一mxml中从一个脚本访问另一个脚本的函数
这是my.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>
<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。。。