9/29/2010 7:52:01 AM
Title:
Difference between movieclip and sprite?
I have a question in mind from long time. What is the difference between MovieClip and Sprite? I know Sprite is single frame movieclip without timeline we can not use methods like gotoAndPlay and gotoAndStop for sprite. But what else? MovieClip must be having some major advantage over Sprite or major difference, any idea?
Thanks
Davis
Points: 780
Posts:0
9/29/2010 8:46:16 AM
Sprite is the most basic object we have in flash with only the smallest number of properties required to exist in flash , its similar to a drawing object created in flash. It does not have timeline and actionscript inside so it basically a design element. Sprite is very light weight and can be used to draw graphics where movieclip is not required. For e.g if you want to draw a rectangle object , you can simply declare a sprite and draw rectangle in sprite. So this is a very light weight object you created.
9/29/2010 9:22:42 AM
Thanks for sharing. The info provided is very help full to understand. I hope there will be some other differences.
9/29/2010 10:03:59 AM
Sprite Class is introduced in AS 3.0 . The reason behind was to provide a light weight graphic element which provides similar functionality to movieclip but without timeline. Sounds not so important but with actionscript 3.0 the scripting became extensive in flash, and developers started creating lot of components. Now you can understand that for creating User Interface most of the times we do not require animation inside which means no time line required. To give you an example lets assume we create 20 buttons for our flash application. Now If we are using movieclips inside buttons then they all will play there timeline and hence put stress on processor unwarrantably. So in this case we have 20 movieclips playing simultaneously without the need. But if you use 20 sprites as design inside your buttons then there is no processor overhead. So actually the sprite class we introduced so we can create User Interface without compromising performance.
For more technical Information you can see the details on Adobe pages :
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/Sprite.html
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/MovieClip.html
9/30/2010 12:54:07 AM
Thanks bob_senoir this is very use full information. It cleared lots of questions :)
7/14/2011 9:26:04 PM
Cool nice description bob_senior and Davis.
Thanks