奇怪的问题,谁遇到过
我建了个module
然后写了个button
<mx:Button x="10" y="10" label="button" click="Alert.show('hello');"/>
在主文件执行加载这个module后点击按钮,这时就会报错
变量 mx.managers::PopUpManager 未定义。
但是如果把Alert 提出来写就没事
<mx:Script>
<![CDATA[
import mx.controls.Alert;
function fun():void{
Alert.show('hello');
}
]]>
</mx:Script>
<mx:Button x="10" y="10" label="Button" click="fun();"/>
这样就没事。。
这是怎么回事。
还有一点 。 直接在主文件里这样写<mx:Button x="10" y="10" label="button" click="Alert.show('hello');"/>
是没问题的,而且主文件里这么写了,然后再加载module,错误也就奇怪的消失了