Cool text codign effect for flash menus

There are plenty of web sites using some kind of text typing effects. I always wandered how it is done. Searching for solution I found sample typewriter actionscript at . Wich was really compact and clear. Also some time ago one of my friends asked me to help with his text efect that types new text, shows random characters from text, random underscores and hyphens and if there is some existing text show it descending. I did it then but cann’t remember how. Because there also I adjusted some existing code.

Here is the preview of what it is going to be like.

And here is code that I adjusted for making that kind of effect.
Author: Vepa Halliyev
//usage textfield.typeWriterx("string to type",50);
TextField.prototype.typeWriterx = function(str, ms) {
//define variables for referencing to them in functions
var me = this;
var i = 0;
var old_text = me.text;
var old_text_len = old_text.length;
var new_text_len = str.length;
var rand_str = str+"-------___________ ";
//this is done to clear not finished interval from previous command.
//usefull on consecutive menu rollovers
if (me.typeWriterx_itv != undefined) {
me.typeWriterx_itv = undefined;
var itv = setInterval(function () {
me.text = str.substring(0, i)+me.typeWriterx_rand(rand_str, (str.length-i));
dec_count = (old_text_len-new_text_len-i*2);
if (dec_count<0) { dec_count = 0; } else { me.text += old_text.substr(i, dec_count); } i++; if (i>str.length and dec_count == 0) {
me.typeWriterx_itv = undefined;
}, ms);
me.typeWriterx_itv = itv;
TextField.prototype.typeWriterx_rand = function(str, num) {
//return rundom letters from string
var r_str = "";
for (i=0; i < num; i++) { r_str += str.substr(random(str.length), 1); } return r_str; }; /* TEXT EFFECT FUNCTIONS END */

And here are the source files in zip format. Click to download cool flash text effect source code.

2 thoughts to “Cool text codign effect for flash menus”

  1. AHH that’s great stuff Vepa.

    I’ve been looking for this text effect again and I just happened to come across a page on google which has a link to your website. perfect

    Why this the enter code text underneath this form in spanish? or another language?

Comments are closed.