Why does Flash still offer to declare library items as either MovieClip, Graphic or Button? Is this just for backwards compatibility or is there any reason not to use MovieClip for everything? (Well, Button does have some additional functionality, but what about Graphic? does a Graphic have any advantage over a MovieClip?)
Why does Flash still offer to declare library items as either MovieClip, Graphic or
Share
This tree might give you a good idea of what you’re asking:
Basically, the further up the tree you are, the more lightweight the object is going to be. As you can see,
SimpleButtonis going to be lighter and more suitable for situations where you only need the functionality of a click-able button with different states, rather than usingMovieClipthat can act as a container, have a timeline, etc etc.It’s good practice to try and aim for the use of the most primitive types possible. For example, if you’re not going to have timeline animation for a graphic, use
Sprite. If ontop of that you’re not going to be adding anything additional into the graphic, useShape, and so on.Something major to note is that
MovieClipis the heaviestDisplayObjectyou can use.