简体   繁体   English

通过mxmlc编译器编译ActionScript 3.0类时,SWF文件为空白并且没有错误

[英]Blank SWF file and no errors when compiling ActionScript 3.0 class through mxmlc compiler

I have two action-script classes one is instantiated in the other. 我有两个动作脚本类,一个在另一个实例化。 It works fine in flash professional cc but when I use the mxmlc compiler via the command prompt, it compiles a blank swf without any errors. 它在Flash Professional CC中工作正常,但是当我通过命令提示符使用mxmlc编译器时,它将编译空白的swf,而没有任何错误。

Monster.as 怪物

package {
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.media.SoundMixer;
    import flash.events.Event;
    import flash.events.KeyboardEvent;
    import flash.utils.Timer;
    import flash.events.TimerEvent;

    public class Monster extends Sprite {
        public function Monster() {
            // constructor code
            var imageLoader: Loader = new Loader();
            var image: URLRequest = new URLRequest("female-monster.png");
            imageLoader.load(image);
            addChild(imageLoader);
            imageLoader.x = 0;
            imageLoader.y = 0;
        }
        public function roar():void {
            var mySound: Sound = new Sound();
            mySound.load(new URLRequest("monster.mp3"));
            mySound.play();
        }
        public function visibleMonster():void {
            this.alpha = .5;
        }

    }

}

addMonster.as addMonster.as

package  {
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import Monster;

    public class addMonster extends MovieClip {
        public var monster:Monster;

        public function addMonster() {
            // constructor code
            monster = new Monster();
            addChild(monster);

            monster.roar();
            monster.moveMonster();
            monster.visibleMonster();
        }

    }

}

Is it possible that there are options I need to use when running the command to compile? 运行命令进行编译时是否可能需要使用一些选项?

通过关闭正在使用该文件的Dreaweaver和Flash应用程序来解决问题,我正在尝试运行mxmlc编译器来编译as文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM