一个雪碧可以包含一个MovieClip? [英] Can A Sprite Contain A MovieClip?

查看:144
本文介绍了一个雪碧可以包含一个MovieClip?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯...我正在创建一个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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆