Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Flex effects components

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to use Flex effects components, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Flex effect component

A wealth of effects components are available in Flex. Because Flex effects are a gradual process based on time, all effects have the duration property, which sets the playback time in milliseconds. You can also control the number of times the effect is played and the interval between repeating the effect (in milliseconds) by setting the repeatCount property and the repeatDelay property, respectively. If you want to delay calling the Flex effects component after the trigger is triggered, you can use the startDelay property.

1) AnimateProperty animation effect

AnimateProperty in the Flex effects component is the effect used to animate the properties or styles of the component. We can use its property property to set the properties on the target object that need to be animated, and then set the fromValue property and the toValue property to provide the start and end values of the property for the effect. For example, the following code uses a mouseDownEffect trigger, which triggers the AnimateProperty effect when a picture is clicked. Within 1 second, the scaleX property of the Image object changes from 1 to 2 and is stretched horizontally. The code is as follows:

If you want to set the effect through style, you can set the isStyle property to ture, and then style the target object through the setStyle () method to achieve the purpose of setting the effect.

2) Blur blur effect

Blur is a blur effect in the Flex effects component. This effect uses the flash.filters.BlurFilter filter, and if you apply the Blur effect to a component, you can no longer apply the BlurFilter filter to that component, nor can you apply the Blur effect again. The following code triggers the Blur effect through the mouseDownEffect trigger of the Image object, and the Image object gradually becomes blurred within 1 second. The code is as follows:

3) erase effect of WipeUp, WipeRight, WipeDown, WipeLeft

These classes in the Flex effect define an erase effect in four directions, which is usually used in conjunction with showEffect and hideEffect triggers and is very easy to use, as in the following example.

Code listing WipeSample.mxml

4) Zoom zoom effect

The Flex effect in the Zoom effects component scales objects proportionally around a specified point. Unlike the Resize effect, Resize changes the length and width properties of the target object, while Zoom changes the scaling of the target object. In the following example, the Zoom effect starts when the mouse moves over the picture and reverts when the mouse is moved out.

Code listing ZoomSample.mxml

The above is all the content of the article "how to use Flex effects components". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report