A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24

Thread: slow speed with large amount of text

  1. #21
    Senior Member
    Join Date
    Jul 2010
    Posts
    111
    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!

  2. #22
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #23
    Senior Member
    Join Date
    Jul 2010
    Posts
    111
    I use setIntervals, but how would I use it in this case?

  4. #24
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center