Can A Sprite Contain A MovieClip?

假装没事ソ 提交于 2020-01-24 19:38:07

问题


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:


Yes.

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



来源:https://stackoverflow.com/questions/2321152/can-a-sprite-contain-a-movieclip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!