Article

Home » Design and Layout » Flash Tutorials » Flash Script - Random Text Effect With Default Text Display

About the Author

SitePoint

View all articles by SitePoint...

Flash Script - Random Text Effect With Default Text Display

By SitePoint

July 24th, 2003

Reader Rating: 7

It looks cool... and it's easy! Here's what you need to create your own random text effect.

1. Create a text field and name it. I gave mine a variable name of "shuffle".

2. Convert the textfield to a movie clip, and name it "Random".

3. Right click the movie clip and access its actions. Insert the following action:

onClipEvent (enterFrame)  
{
if(!_root.flag)
{
shuffle = chr(random(26)+65);
}
}

4. Create 4 duplicates of the movie clip.

I want the RandomText movie clip to display Flash, then pause for a moment, then continue. There are 5 letters in the word "flash", so I'll use 5 movieclips.

5. Select the first movieclip and give it an instance name of "t1"; name the second one t2, and so on for the other movieclips.

6. Name the current layer "text", extend it three keyframes, then lock the layer.

7. Create a new layer above the text layer, and name it "actions". Create three blank keyframes in this layer. In the first keyframe, insert this action:

i = 0
flag = 0
lapse = 20;
display = 10;

8. In the second keyframe, insert this code:

i = i + 1
if(i > display)
{
flag = 1;
_root.t1.shuffle = "F";
_root.t2.shuffle = "L";
_root.t3.shuffle = "A";
_root.t4.shuffle = "S";
_root.t5.shuffle = "H";
}
if(i > lapse)
{
flag = 0;
i = 0;
}

9. In the third keyframe, insert this action:

gotoAndPlay (2);

10. That's it! Run the movie, and you'll see the effect above.

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Rate This Article

  • 1
    Poor
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
    Great

Comment on This Article

Have something to say?

Post A Comment

You need to be a member of the SitePoint Forums to comment on this post. Sign Up

Already a member? Post using your SitePoint Forums account: