-
Script kiddie
Embedded SWF becomes a Sprite; how do I apply masks to it?
Working on Invasion (still ¬_¬), I'm embedding a symbol of a character in:
Code:
[Embed(source = "../sprites/MagusImport.swf", symbol = "Magus")]
public var MagusSWF:Class;
So far so good. Imports my Magus symbol in fine. Now I try to create one:
var MagusMC:MovieClip = new MagusSWF();
Type coercion fails. So MovieClip isn't possible apparently (any idea why?) Sprite works though, so I run with that:
var MagusMC:Sprite = new MagusSWF();
However, there's some complicated visual effects that need to go on that guy. He's got some movie clips inside him that need their cacheAsBitmap turned on, and alpha masks that need to be enabled through ActionScript.
Now, as far as I can tell, the symbol's children lose their instance names when I turn it into a Sprite. So... what are my options? Can I simply not get MovieClips through [Embed] (ie, will I have to use URLLoader, which I would really like to avoid)?
-
http://www.bit-101.com/blog/?p=853
i think that the symbol property is the linkage ID.
you havent given the new class you created the same name at the symbol in lower case.
try this:
Code:
[Embed(source = "../sprites/MagusImport.swf", symbol = "MagusSWF")]
public var MagusSWF:Class;
im not 100% though
flos
EDIT: no, im wrong, it applies to sprites.
Last edited by flosculus; 10-13-2009 at 09:46 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|