Flash:影片剪辑,图形,按钮 [英] Flash: Movieclips, Graphics, Buttons

查看:93
本文介绍了Flash:影片剪辑,图形,按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么Flash仍然提供将库项目声明为MovieClip,Graphic或Button?这是仅仅是为了向后兼容,还是有任何理由不对所有内容都使用MovieClip? (好吧,Button确实有一些附加功能,但是图形呢?图形比MovieClip有什么优势吗?)

Why does Flash still offer to declare library items as either MovieClip, Graphic or Button? Is this just for backwards compatibility or is there any reason not to use MovieClip for everything? (Well, Button does have some additional functionality, but what about Graphic? does a Graphic have any advantage over a MovieClip?)

推荐答案

这棵树可能会让您对所要询问的内容有个好主意:

This tree might give you a good idea of what you're asking:

基本上,树越远,对象的重量就越轻.如您所见,SimpleButton将变得更轻巧,更适用于您只需要具有不同状态的可点击按钮的功能,而不是使用可以用作容器的MovieClip并具有时间轴的情况,等等.

Basically, the further up the tree you are, the more lightweight the object is going to be. As you can see, SimpleButton is going to be lighter and more suitable for situations where you only need the functionality of a click-able button with different states, rather than using MovieClip that can act as a container, have a timeline, etc etc.

尝试并尝试使用最原始的类型是一个好习惯.例如,如果您不希望图形具有时间轴动画,请使用Sprite.如果您不打算在图形中添加任何其他内容,请使用Shape,依此类推.

It's good practice to try and aim for the use of the most primitive types possible. For example, if you're not going to have timeline animation for a graphic, use Sprite. If ontop of that you're not going to be adding anything additional into the graphic, use Shape, and so on.

主要要注意的是MovieClip是您可以使用的最重的DisplayObject.

Something major to note is that MovieClip is the heaviest DisplayObject you can use.

这篇关于Flash:影片剪辑,图形,按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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