PDA

View Full Version : sprite or movie clip ?



daa7k
May 30th, 2007, 04:49 PM
Hi, I've read that it is more efficient in AS3 to use sprites than movie clips when I don't need timeline. I want to use only AS3 for moving graphics, not timeline, so it would be good to create sprite objects. But is there a way to load vector graphic made in Flash to it?

I mean, to use Flash CS3 graphical editor to draw something, then use AS3 to move it. If there was a possibility to create some drawing in Flash, then save it to library as symbol, then load it in AS3 to a sprite (like I can load a bitmap). But only "Movie Clip" symbol instances can have names, not "Graphic" instances, so it looks that the only way is to create a Movie Clip in Flash.

It means that if I want to draw in Flash and not in AS3, I must use Movie Clips?

Krilnon
May 30th, 2007, 05:05 PM
You should search around first. In the (currently) 12th thread down from this thread, a thread named 'Sprite vs. MovieClip', there's a post that you might think is useful:

http://www.kirupa.com/forum/showpost.php?p=2115857&postcount=8

daa7k
May 30th, 2007, 05:21 PM
I've read this before but it doesn't answer my question.

TheCanadian
May 30th, 2007, 05:28 PM
Set the class association in the linkage settings of the symbol in the library to Sprite or a Sprite subclass.

Krilnon
May 30th, 2007, 05:47 PM
It seems like it answers your question. :sigh:


It means that if I want to draw in Flash and not in AS3, I must use Movie Clips?

you can use Sprite as a [base] class for movie clip symbols in your timeline


trace(instanceOfDrawingClass is Sprite); // true

daa7k
May 30th, 2007, 06:33 PM
OK, now I see what it means "base class", but sorry, it was not so straightforward (the base class option is grayed until you check the export option, I didn't notice it). But it seems to work, and that's what I needed, thanks a lot for the answers !