Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
  1. Code
  2. Effects

Quick Tip: Create a Typewriter Text Effect Class


In this Quick Tip, we'll create a static, re-usable ActionScript class that will produce a Typewriter effect with a single line. Read on!

Step 1: Brief Overview

We'll split a user defined string into an array, and then add the resulting letters to a TextField one by one using the Timer class.

Step 2: Typewriter Class

Our class will be static, which means it doesn't need to be instantiated using the new keyword. To access a static class member, use the name of the class instead of the name of an instance.

Create a new ActionScript file and write the following code:

Step 3: Usage

The usage couldn't be easier - just add the Typewriter.as class to your project folder and use the following code:

That's it, test your movie and you'll see your TextField using the Typewriter effect.

Step 4: Example

I used the class in on this example swf so you can see the effect:


Use this class to create your own effects!

Thank you for reading. If you'd like a more advanced version of this effect for use in your projects, take a look at Rasmus Wriedt Larsen's Letter By Letter Animation.

Looking for something to help kick start your next project?
Envato Market has a range of items for sale to help get you started.