Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Text Looping

Status
Not open for further replies.

Quijian

ISP
Jul 9, 2004
32
US
I have been using the for loop statement to create a loop and I would like to display the values generated by the loop statement in a text box.

port=0
do {
port=port+1
change.text=port
} while (port<9999);

"Change" is a dynamic text box. All I keep getting is the end result, which is 9999. It is blank for a while, then immediately jumps to 9999 Any and all suggestions will be greatly appreciated.
 
It's because the whole loop executes on one frame - you'll only ever see the end result this way. If you want to see the display count up you could do something like this:

Code:
port = 0;
this.onEnterFrame = function() {
	change.text = port;
	(port<9999) ? port++ : delete (this.onEnterFrame);
};
 
I tried that, and nothing happened...thanks anyway...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top