-
Hey Nig, do you have any tips for making code in script wait until it's 'run through' before it proceeds to the next script? It's like, in my 'while' code, like:
stop()
i=1
while(1<50000){
do a bunch o' stuff
i=i+1
}
if(i=50000){
gotoAndPlay(10)
}
I put a dynamic field in so I could see what number "i" was at, and the number got to 50000 before it was even done doing what it was doing. So after that, when I tell it to goto and do something else, it just goes and does it without waiting. I cant do any sort of "stop" and gotoAndPlay when i=50000 because it hits that number even before it's done doing it's thing. Can you think of any way I can make it stop and wait till it's done? Thanks!
-
Prid - Outing
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
I use setIntervals, but how would I use it in this case?
-
Prid - Outing
Actionscript Code:
function doSomething(){ trace("FUNCTION CALLED"); }
if(i=50000){ setTimeout(doSomething, 1000); }
setTimeout is equivalent to setInterval, but instead, it is only executed ONCE, and deletes itself, sparing you the hassle of doing so manually
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|