About the WavingFlag component

The WavingFlag component is a visual component that lets you apply a wave-like ripple effect to a movie clip or bitmap. The ripple effect gives the appearance of a flag waving in the wind. You may control elements such as wind-speed, shadows, and supply your own flag image or movie clip. Flash 8 is required for this component as it utilizes the DisplacementMapFilter and BitmapData classes.

Related topics

WavingFlag parameters

You can use the the custom interface of the Component inspector to set the following properties for each WavingFlag component instance while authoring:

billow three different settings of a cloth 'billowing' effect.

colorOffset used as a color offset in the ColorMatrixFilter applied to the final flag image.

colorScale used as a color scale in the ColorMatrixFilter applied to the final flag image.

flagImage a relative or absolute path to an image file to be used as the flag.

flagLinkageId the linkage ID of the movie clip to be used as the flag.

isPaused true if the flag waving motion is paused (off).

livePreview if true, show an animating flag with shadows on the stage at authortime.

rotation angle of rotation (in degrees) of the flag- used to overcome limitiations, see Special notes about applying rotation.

shadows value from 1-100 for the strength of shadows covering the flag.

windSpeed a value indicating how hard the wind blows across the flag.

You can write ActionScript to control these and other characteristics of how the WavingFlag component displays and functions using its properties, methods, and events. Not all of these properties can be modified from the authoring interface. For more information, see WavingFlag class.

 

Creating an application with the WavingFlag component

To add a WavingFlag component to your flash document while authoring, simply drag the WavingFlag component from the Components panel onto the stage. A large placeholder flag will appear on the stage. (The component is located under the flashextension.net node in the Components panel). To show a specific flag, change the flagLinkageId property to the linkage identifier of any moive clip in your library.

Also included with the package is a set of 19 country flags. To include one of these flags in your Flash movie, open the common library using Window > Common Libraries > World Flags. Drag and drop the flag of your choice into your own library, then set the flagLinkageId property of your flag component to the country of the flag, for example "usa".

Special notes about applying rotation

Due to limitations in the way Flash works with components on the Stage, it's not possible to preview rotation applied to the WavingFlag component, or to use the 'Free Transform Tool' to rotate the component and get a reliable result when you export the movie. There are 3 workarounds to this issue:

1. Use the rotation property in the Parameters panel. Setting the rotation property applies an exact rotation to the flag when the movie is exported, but it still will not look right in live preview.

2. Use ActionScript to set the _rotation property on the component at runtime. Simply give the component an instance name and set the _rotation property in the ActionScript for the frame your component is on. For instance, if your component is called 'usa_flag' and you want to rotate 40 degrees, add the following code:

usa_flag._rotation = 40;

3. Put your flag component in a holder MovieClip and transform the holder as you normally would. This would allow you to use the Free Transform Tool even though it still will not look correct on the stage. The exported movie will be correct.