形状,雪碧,影片剪辑等显示对象:何时使用? [英] Shape, Sprite, MovieClip and other display objects: when to use?

查看:220
本文介绍了形状,雪碧,影片剪辑等显示对象:何时使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个在 flash.display使用包大ammount的显示对象。目前尚不清楚,我在什么情况下我应该使用图形雪碧影片剪辑。什么是使用他们每个人的亲和反政府?

there's a large ammount of display objects in flash.display package. It's not clear for me in what situation I should use Shape, Sprite or MovieClip. What is the pro and contras in using each of them?

感谢你在前进!

推荐答案

  • <一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Shape.html">Shape是最简单的显示对象,你可以添加在舞台上。它是 最有限之一:你不能添加童装给它(不扩展的DisplayObjectContainer),不具有交互性(不扩展的InteractiveObject),并没有一个时间表
  • <一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Sprite.html">Sprite扩展级DisplayObjectContainer,的InteractiveObject,因此它的互动,你可以添加孩子给它。这是我认为最有用的显示类,只要你不需要时间表。
  • <一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/MovieClip.htmlhttp://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/MovieClip.html">MovieClip扩展Sprite,因此上述所有的真实,你也可以得到与时间轴控制相关的方法/属性,但要注意,这是一个动态类,这样你就可以做一些哈克的事情上飞,但你会失去了速度。

  • Shape is the simplest display object you can add on stage. It is the most limited one: you can't add childen to it (does not extend DisplayObjectContainer), does not have interactivity (does not extend InteractiveObject), does not have a timeline
  • Sprite extends DisplayObjectContainer and InteractiveObject, therefore it's interactive and you can add children to it. It's the most useful display class in my opinion, as long as you don't need a timeline.
  • MovieClip extends Sprite, so all of the above are true and you also get methods/properties associated with timeline control, but note that it's a dynamic class, so you can do some hacky thing on the fly, but you'll lose speed.
  • 总之,坚持雪碧在大多数情况下,除非你需要与Flash创作影片剪辑集成。形状是很方便的快速绘制成和它的轻不是雪碧,但不是很灵活的,因为你不能嵌套其他元素吧。

    In short, stick to Sprite in most cases, unless you need to integrate with MovieClips from Flash Authoring. Shape is handy to quickly draw into and it's 'lighter' than Sprite, but not very flexible since you can't nest other elements to it.

    这篇关于形状,雪碧,影片剪辑等显示对象:何时使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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