Actionscript 3:将属性应用于所有变量或 MovieClip
我想知道是否可以,如果可以的话,如何将一个 var 的属性同时应用于多个 var。我正在制作一个点击游戏,我想将 buttonMode
属性应用于(MovieClips)的多个变量。
我不知道这是否可能,也不知道这有多简单或多高级,但它会非常方便。
我已经在谷歌和这个网站上使用不同的搜索词/关键字搜索了可能的答案,但找不到任何接近的答案。我还尝试了带有星号的不同操作,例如 *.buttonMode = true
和 movieClip.*.buttonMode = true
但没有成功。
任何帮助将非常感激。
I want to know if it's possible, and if so how, to apply a property of a var to multiple vars at once. I'm making a point-n-click game where i want to apply the buttonMode
property to multiple variables (of MovieClips).
I don't know if this is even possible or how simple or advanced this is, but it would be damn handy.
I have searched on Google and this site for a possible answer, with different search terms/keywords, but can't find anything close. I also tried different things with an asterisk such as *.buttonMode = true
and movieClip.*.buttonMode = true
but no success.
Any help would be very much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您真正需要做的就是将所有这些影片剪辑的特定属性绑定到可绑定变量。
有关可绑定变量的更多信息,请访问:
1. http://www.flexafterdark.com/docs/ActionScript-Bindable
2. http://jacwright.com/blog/54/actionscript- 3-bindable-dynamic-objects/
当您希望许多对象引用一个属性,并且在更改此属性时,绑定到此可绑定变量的对象中的某些属性时,可绑定会派上用场会改变。
All you really need to do is bind a specific property of all these movieclips to a bindable variable.
For more information on bindable variables visit :
1. http://www.flexafterdark.com/docs/ActionScript-Bindable
2. http://jacwright.com/blog/54/actionscript-3-bindable-dynamic-objects/
Bindables come in handy whenver you want many objects to refer to a property , and on the change of this property, some property in the object(s) which have binded to this bindable variable will change.