开发者

AS3 Embed Code Error

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜