简体   繁体   English

使用Flex 3 / Actionscript在背景中对一系列图像进行动画处理?

[英]Animating a sequence of images in the background using Flex 3/Actionscript?

I would like to animate a sequence of background images within a uicomponent but also dynamically add and remove components to this component. 我想为uicomponent内的一系列背景图像设置动画,还希望向该组件动态添加和删除组件。

My first question would be: 1.) What's the best way to animate a sequence of images using Flex 3? 我的第一个问题是:1.)使用Flex 3对一系列图像进行动画处理的最佳方法是什么? 2.) What's the best way to handle adding and removing components on top of the background dynamically? 2.)动态处理在后台顶部添加和删除组件的最佳方法是什么?

Any help/information would greatly be appreciated! 任何帮助/信息将不胜感激!

Thank you! 谢谢!

In the mxml for your ui component declare an mx:Image and give it an id. 在ui组件的mxml中,声明一个mx:Image并为其指定一个ID。 Set up a timer loop that changes the "source" attribute (id.source = ) on your mx:Image at an interval you like. 设置一个计时器循环,以您希望的时间间隔更改mx:Image上的“ source”属性(id.source =)。 To add and remove components dynamically just use addChild/removeChild or addElement/removeElement depending on the type of display object you're working with. 要动态添加和删除组件,只需根据要使用的显示对象的类型使用addChild / removeChild或addElement / removeElement。 The mx:Image should always be behind the dynamically added components as it was created and added before them. 在创建和添加动态添加的组件之前,mx:Image应该始终位于它们之后。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM