开发者

AS3 Embed Code Error

开发者 https://www.devze.com 2023-02-01 12:30 出处:网络
package { import flash.display.*; public class main extends Sprite { [Embed(source=\"file.swf\")] public static const MY_FILE:Class;
package {

    import flash.display.*;
    public class main extends Sprite {

        [Embed(source="file.swf")]
        public static const MY_FILE:Class;

        public function main() {

            var mySprite:Sprite = new MY_FILE() as Sprite;
            trace("done " + MY_FILE);
            addChild(mySprite);
        }

    }
}

am getting this error.

done [class main_MY开发者_StackOverflow_FILE]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at Filters()

Does anyone know what is the reason?


The problem is probably in your embedded swf. Your Script seems fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消