1

我有这个到目前为止工作的 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;

但这还不够……你怎样才能让它发挥作用?

4

1 回答 1

1

如果您尝试在 中运行gotoAndPlayMain它会抛出该错误,因为Sprites 没有时间线。如果是这样,请尝试扩展MovieClip

于 2013-03-23T13:46:06.307 回答