The SpinTextEffect Component

Component 

The last effect in the trio of components is called the SpinTextEffect. It uses the shared font technology just as the scramble component did. Create a new Flash movie and drag an instance of the SpinTextEffect component from the Components panel. For the effect to work, you need to create a shared font, so do so now and give it the linkage name "spin_font." Then, test the movie to see the effect, as shown in Figure 7.15. Reference the file SpinEffect01_Sample.fla in the Chapter 7 folder to see how a sample has been set up.

click to expand
Figure 7.15: Test the SpinEffect01_Sample.fla file. The letters fly from the foreground to center stage.

When you publish, you will see all of the individual letters of the text set flying in from the foreground. Each letter spins around the x-axis as it flies through 3D space to the 2D surface of the stage. Once a letter reaches the stage, it finishes its spin and then comes to a rest in its final position.

Just like the previous two components, this component can handle many sets of text. Despite the greater complexity of this component compared to the others, the SpinTextEffect component has few parameters. Table 7.3 provides a full list of parameters.

Table 7.3: Parameters for the SpinTextEffect Component

PARAMETER NAME

DESCRIPTION


Text Messages

Array that holds all the sets of text that you want the component to cycle through. The only HTML tag enabled in these messages is the line break tag <br>.

Text Size

Size of the text in each set.

Font Linkage

Linkage name of the shared font you created in your library.

Text Color

Color of the text in each set.

Text Kerning

Number of pixels between each letter in the set of text.

Spin Radius

Radius of the circle each letter spins around as they fly from the foreground to the 2D flat stage.

Frame Delay

Once the text is fully animated in, this parameter determines the number of frames that must pass before the next set of text begins to animate in.

Loop

True or false value that determines if the sets of text should be played continuously in a loop or not.

We have already encountered all but one of the above parameters, so there should be very little confusion so far, although the Spin Radius parameter does not make a whole lot of sense. To understand that parameter, you must understand the paths the letters are traveling from their starting position to their final destination.

Imagine for a moment that your computer screen is not flat, but instead renders everything in 3D space. In this case, all of the letters start behind you, moving forward towards the stage of the Flash movie. As they move towards the stage, they each oscillate up and down and back and forth, around the x-axis. This distance from the x-axis that the letters travel as they move up, down, forward, and backward is controlled by the Spin Radius parameter. Values between 0 and 50 are generally the best-looking, although no particular value produces a better result than any other.

In the file SpinEffect02_Sample.fla, the text effect contains a couple of small changes. To show that the kerning problem of the ScrambleTextEffect component is still present in this component, I've lowered the kerning value from 0 to -2. Also, I've lowered the spin radius of the letters from 20 to 5. These two changes actually produce quite a different effect, mainly due to the spin radius, as you can see in Figure 7.16.


Figure 7.16: Use a small value for the spin radius to produce different effects. This also constrains the component to a smaller area, if you want.

If you read the parameter descriptions carefully, you might have noticed that the sets of text in this component follow the same rules as the text in the ScrambleTextEffect component as far as HTML is concerned. No tags other than the line break tag are allowed. Open the file SpinEffect03_Sample.fla to see the line break being used, as well as a larger spin radius value, as shown in Figure 7.17.

click to expand
Figure 7.17: The line break tag is the only HTML tag you can use with the SpinTextEffect component.

With all the components discussed in this chapter, you may feel that you have quite a bit of information to memorize. Fortunately, the ScrambleTextEffect and SpinTextEffect components act nearly identical outside of their animations—meaning the same quirks that were involved in the live preview of ScrambleTextEffect, such as font and letter spacing, are still present in SpinTextEffect.




The Hidden Power of Flash Components
The Hidden Power of Flash Components
ISBN: 0782142109
EAN: 2147483647
Year: 2002
Pages: 111

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net