tags:

views:

39

answers:

1

Hmmm... I'm working at creating an AS3 UI library, since most of the ones out there each seem to miss out at least 1 feature I need. In order to keep it lightweight, I created everything from scratch. I use Sprites to render just about anything. But I want to allow the user of the library the possibility of adding a custom graphic for a button. Now... maybe that graphic is a MovieClip which has a nice animation within it.

So can I say sprite.addChild(mc) and then if I do mc.play, will the mc play within a sprite?

Thank you ::- ).

+1  A: 

Yes.

Sprite extends DisplayObjectContainer which can contain any DisplayObject or subclass of DisplayObject.

Sam
I know that, but in the same time, MC has frames, sprite doesn't. It's a container, but wouldn't it be "annoyed" by the fact that my MC has frames? I am asking you this because I got no Flash CSx on my machine now and I can't test. The idea is to import MCs authored in Flash CSx which means multiple frames (something you can't do programatically).
Axonn
Yes, if you call `play()` on the MC it will play even when added to a `Sprite`.
Sam
Thanks Sam ::- D.
Axonn