问题描述
嗯...我正在创建一个AS3的UI库,因为大部分在那里似乎都错过了至少1个我需要的功能。为了保持轻量级,我创建了一切从头开始。我使用Sprites来渲染任何东西。但是我想让图书馆的用户有可能为一个按钮添加一个自定义图形。现在...也许这个图形是一个MovieClip,它有一个很好的动画。所以我可以说sprite.addChild(mc)然后如果我做mc。玩,将MC内玩雪碧?
谢谢:: - )。
Sprite extends DisplayObjectContainer 可以包含任何 DisplayObject 或 DisplayObject 的子类。
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 ::- ).
Yes.
Sprite extends DisplayObjectContainer which can contain any DisplayObject or subclass of DisplayObject.
这篇关于一个雪碧可以包含一个MovieClip?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!