PDA

View Full Version : sprite question



saad
April 29th, 2009, 04:33 AM
I thought that sprites did not have frames then how come when I do this, I can use the goto property?

in my main class I do this:

public var miniSprite:Sprite;

then in the main function:

miniSprite = new mcStuff();
playerClip.addChild(miniSprite);

mcStuff is a class that has linkage to a movieclip with multiple frames, so in a sense the sprite is holding a movieclip (the mcStuff class extends to MovieClip) is that right?

Shaedo
April 29th, 2009, 11:25 AM
if you try this:

var mySprite:Sprite;
var mySprite = new myLibrary_mc;//myLibrary_mc is a movieclip in the library
addChild(mySprite);

you will get the error:

1067: Implicit coercion of a value of type Class to an unrelated type flash.display:DisplayObject.

I am not sure how, technically, your example differs from this...?

saad
April 29th, 2009, 04:38 PM
my myLibrary_mc is a class that extends a MovieClip on stage.

senocular
April 29th, 2009, 04:53 PM
Sprites can't have frames, but its perfectly fine if they have child MovieClips that have frames. Those frames are separate from the sprite.