PDA

View Full Version : fade in dynamic text


mandrews
12-16-2005, 02:38 PM
what is the easiest way to raise the alpha (or alpha tween) in on these dynamic text fields?...

here is how i load my .txt file:
onClipEvent (load){
this.loadVariables("comments.txt");
}

i put that script on the movie clip that my text fields are in. then i have the text fields' variables named, "simple", "step1", and so on and use the &simple=Such and Such in my .txt file.

is there a simple script i can put in the onClipEvent script for each dynamic text field? or put a script on the text field?

thanks.

mcmcom
12-16-2005, 03:11 PM
create a function like this:

function fadeAlphaIn(target)
{
var myClip:MovieClip = target;
myClip._alpha = myClip._alpha + 10;
if(myClip._alpha >= 100)
{
clearInterval(tId);
}
}

then call it with a setInterval

var tId = setInterval(fadeAlphaIn,50,targetMovieClip);

make sure to pass it the target clip so it knows what to fade in.

HTH
mcm