开发者

load swf to background of sprite

i have saved my background as a swf file.

    [Embed(source="Back.swf")]
    private var SomeClass:Class;

Now inside the main class i added

addChild(SomeClass);

But i get this red problem :- Description Reso开发者_运维知识库urce Path Location Type 1067: Implicit coercion of a value of type Class to an unrelated type flash.display:DisplayObject. Test.as /Test/src


When you are using the addChild method, you need to parse there a DisplayObject type. in this case your SomeClass is Class type.

try:

addChild ( new SomeClass () );

or

addChild ( new SomeClass () as MovieClip );
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜