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 );
精彩评论