PDA

View Full Version : textEffect


cortomaltese
01-25-2005, 12:29 PM
has anyone got an idea why this code only runs on the 1. frame???

// by tommywizbang/Xenozip
// Enjoy!
this.onLoad = function() {
tf = "";
text = "your text comes here... ncvdkjsbnvcjkabdfnvjnbaljbnjdalnbvjanvnvjkdsanvkln asjlv";
_root.tf_max = text.length;
// Set whatever speed you like! The function below takes care of any problems. If the speed wacks it out, the tf is set to the text string without error.
// you don't notice anything becuase the text is moving fast anyway.
speed=1;
};
this.onEnterFrame = function() {
if (_root.tf_max<=1) {
// This sets the tf to the text string. This is the fix for it wacking out the first words in the text becuase of the max length.
output = substring(text, 1);
tf = output;
break;
} else {
tfLength = _root.tf_max-speed;
_root.tf_max = tfLength;
output = substring(text, tfLength, speed);
tf = output+tf;
}
};
MovieClip.prototype.reset = function () {
tf = "";
// Reset the tf_max to allow it to "retype" the text
_root.tf_max = text.length;
}


help!!

cortomaltese
01-25-2005, 12:40 PM
ok, i figured it out..
"onLoad" part of the code goes to the first frame, anything else goes wherever you want to start your ani..