Typewriter effect in flash can be useful in creating banners or presentations. This tutorial explaines how to create a flash type writer effect using ActionScript.
Steps to follow:
1. Open Flash 8, create a new document and save it as typeeffect.fla. Go to the Properties panel or choose Modify >> Document (Ctrl+J) and set the dimensions of your flash document to 350×200 pixels.
2. Insert two layers so that the total number of layers is three. Rename them from top to bottom as it follows: actions, text, background (like in the image below).
3. In the first frame of the background layer insert a picture with dimensions 350×200. The one I used is from pdphoto.org. Choose File >> Import>> Import to Stage and select the picture from your computer. Align the picture to center of the stage both horizontal and vertical from the Align panel (Window >> Align or Ctrl+K if it is not opened).
4. Click the Text Tool (T) to select it. Go to the Properties panel and set Dynamic Text as Text Type, font Arial, size 25, color white #FFFFFF, bold, align center. Now go to the first frame of the text layer and draw a text field there. Select it and go back to the Properties panel and set W:3 30.0, H: 180.0, give it an instance name of display_txt and then align it to center horizontal and vertical using the Align panel.
5. While the display_txt go to the Filters panel (second tab of the Properties panel). Click the plus sign
to add a filter and choose Drop Shadow from the list that appears. Set the properties as it follows: Blur X:5, Blur Y:5, Angle: 45, Color black #000000.
6. Now go to the first frame of the actions layer and open the Actions panel (F9). Put the following ActionScript code in:
var phrase_string:String="What I want to say : \n I love Fish";
var n:Number= phrase_string.length;
var i:Number=0;
this.onEnterFrame=function(){
if (i<n){
display_txt.text+=phrase_string.substr(i,1);
i+=1;
}
}
Now let’s see what the code does. I use phrase_string variable to hold I want to display. You may put here what text do tou want. The \n is a line break, so finnaly I would have three lines.
The n variable is for holding the lenght of phrase_string. The i variavle is a contor to cover all the chars from phrase_string.
Then I use onEnterFrame event for doing some action: if i is less than n I will add to display_txt.text the char from i position in phrase_string.
7. That it’s all. Test tour movie (Ctrl+Enter) and ask me if you have any doubts.






Entries (RSS)
November 21st, 2007 at 2:11 am
nice tutorial. thanks a lot
December 22nd, 2007 at 12:44 pm
very coooooooooool;keep it up!
January 6th, 2008 at 6:02 pm
I am trying to use this typewriter effect, however all it does is type the first letter of my phrase then repeat.
January 6th, 2008 at 6:10 pm
Whoops. My bad, I forgot to add stop();
January 7th, 2008 at 1:04 am
very interesting.
i’m adding in RSS Reader
January 9th, 2008 at 1:30 pm
it is wonderful..
but i have two queries
1.can we increase the typing speed and
2. can we place the action script frame at any place in the timeline in that layer ( or should it be in first frame only..)
thank you.
January 30th, 2008 at 8:40 am
thanks so much for this tutorial. but i advice anyone who would use this to use a font size of maybe 8 in other see all the test.
January 30th, 2008 at 1:34 pm
What do you mean ?
February 8th, 2008 at 12:58 am
really this is a good tutrial I am enjoying thisone
February 14th, 2008 at 9:24 am
To abishek:
1. Yes you can and the simplest way to do it is modifying the frame rate of your lash document.
2. This movie has only fisrt frame. I don’t know to answer your question because it depends of your movie clip.
February 14th, 2008 at 8:28 pm
a very good tut! ^_________^
thanx so much.
February 26th, 2008 at 1:37 am
hello..this tutorial really mean to me.
but I have other question.
How if I want to create other text,that mean in other lines. Do I have to out the actionscript in the 2nd frame of the action layer?? Please help me
March 12th, 2008 at 1:43 am
i don’t get that action, please give more deatail to that typeeffect text and i am using flash 7, this script work in flash 7 or not
March 12th, 2008 at 6:42 am
how can i loop it?
March 19th, 2008 at 5:21 am
Nice One
Only doubt about how to increase and decrease speed
March 22nd, 2008 at 12:38 pm
Snx for you job!
It has very much helped me!
March 28th, 2008 at 7:02 am
Thanks for the tutorial !
Its great and helped me a lot. To get the multiline effect just choose the multiline while slecting the text properties.
April 6th, 2008 at 11:28 am
After working all day I visited this website and guess what? I sound this source and I don’t feel tired any more! It’s the best entertaining source!
April 20th, 2008 at 11:35 pm
thanks so much for this tutorial. it’s very very simple
September 2nd, 2008 at 2:41 pm
wow ))
its very interesting point of view.
Nice post.
realy good post
thx
September 18th, 2008 at 3:33 am
yeah, i have the same question as john. how can i loop it? anyway - great tutorial, many thanks
September 23rd, 2008 at 8:46 am
Actually,
the += method to add text is already deprecated, it’s better to use the textfield.appendText() method.
October 1st, 2008 at 5:52 am
Hello
Nice site!
Bye