| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi all! I wonder if it's possible in anyway, without using any timelines, to "pause" a for loop.for a couple of second if some statement returns true during the loop? I.e. like this sketch up of a code example: Thanks for any help ![]() for (var i:int = 0; i<100; i++){ if (i devidable by 3) { function pauseLoop():void{ // code to pause 2 sec. + myTextField.text = String(i); } }else(){ // continue loop; } } |
|
#2
| |||
| |||
| there is no way to pause or slow a for-loop or while-loop. you would have to code for breaks in your for-loop(s) or use setInterval() or an onEnterFrame loop to control the loops execution after it starts. |
|
#3
| |||
| |||
| I always value your answers, so thanks for that, Kglad. I'll look into another way of completing my task then ![]() |
|
#4
| |||
| |||
| you're welcome. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.