FORUMS: list search recent posts

Changing text in a dynamic text field.

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
downtownguy
Changing text in a dynamic text field.
on Feb 2, 2006 at 4:27:09 am

Hello,

I have set up a dynamic text field in my Flash movie.

I would like to set up three string variables.

Then, I'd like the text field to display a different string variable every ten seconds.

Any help would be greatly appreciated! :)



Return to posts index

Sher Ali
Re: Changing text in a dynamic text field.
on Feb 2, 2006 at 9:28:09 am

hello downtownguy,

place this code in the timeline, where is the dynamic textfield.

var stringArray:Array = new Array("Nadeem","Ayyub","Amin");
var i:Number = 0;
myText.text = stringArray[i];
var timeInterval = setInterval(changeText,10000);

function changeText(){
(i+=1)>(stringArray.length-1)?(i=0):i;
myText.text = stringArray[i];
}


Sher Ali,
Interactive Media Developer


Return to posts index

downtownguy
Re: Changing text in a dynamic text field.
on Feb 2, 2006 at 7:52:37 pm

Hi Sher Ali,

Thank you very much for your help! I modified the ActionScript slightly. :)

var playerMessage:Array = new Array();
playerMessage.push("Client Name"); // CLIENT NAME HERE
playerMessage.push("Client Video"); // VIDEO NAME HERE
playerMessage.push("Brought to you by Me"); // MY INFO HERE

var i:Number = 0;
displayMessage.text = playerMessage[i];
var timeInterval = setInterval(changeText,10000);

function changeText(){
(i+=1)>(playerMessage.length-1)?(i=0):i;
displayMessage.text = playerMessage[i];
}



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]