1180:调用可能未定义的方法gotoAndPlay

时间:2013-03-23 12:50:07

标签: actionscript-3 air

我有这个AS3脚本到目前为止工作......

stop();

b1.addEventListener(MouseEvent.CLICK, Info001);
function Info001(event:MouseEvent):void {
gotoAndPlay(2);
}

X.addEventListener(MouseEvent.CLICK, Exit001);
function Exit001(e:MouseEvent) {
NativeApplication.nativeApplication.exit();
}

然后,我在.fla文件中添加了一个类......

package
{
    import flash.system.System;
    import flash.system.Capabilities;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.desktop.NativeApplication;
    import flash.utils.setTimeout;
    import com.hdi.nativeExtensions.NativeAds;
    import com.hdi.nativeExtensions.NativeAdsEvent; 

    public class Main extends Sprite
    {       
        public var na : NativeApplication;
        private var admobId:String = 'a1514b5ef85e336';


        public function Main()      
        {
            na = NativeApplication.nativeApplication;
            na.addEventListener('exiting',exit,false,0,true);
            na.addEventListener('deactivate',exit,false,0,true);

            if ( stage ){
                stage.scaleMode = 'noScale';
                stage.align = 'TL';
            }           

            if ( loaderInfo ){
                loaderInfo.addEventListener( Event.INIT, init, false, 0, true );
            } else {
                init(null);
            }
        }

(这里的课程不完整......)

按钮停止工作......: - /

我尝试添加

import flash.events.MouseEvent;

但这还不够......你怎么能让它发挥作用?

1 个答案:

答案 0 :(得分:1)

如果您尝试在gotoAndPlay中运行Main,则会抛出该错误,因为Sprite没有时间轴。如果是,请尝试扩展MovieClip