dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Advanced pause function

  1. #1
    hey all,

    I need to pause a function for a set amount of time.

    This is the best i've been able to come up with but it causes the script to stop responding.


    main (){
    if (doit == true){
    pause();
    }
    }

    pause (){
    timer = new Date();
    now = timer.getTime();
    finish = now + 10
    while (now < finish){
    now = timer.getTime();
    }
    }

    Any one got any ideas? There has to be a way to create a puse with out using the timeline or any goto actions!

  2. #2
    Member
    Join Date
    Jul 2001
    Posts
    56
    Hey creativeflow,
    Try the script found here

    http://www.actionscripts.org/tutoria...ts/index.shtml

    Ive never tried it but i came across it when someone else suggested this site on a thread, it looked pretty useful so i kept it in mind.

    hope it does "it" for you...

  3. #3

    Thanks-But that's not it

    Hello,

    Thanks for the suggestion but I need to do it purly through code. Basically a loop that will keep looping for 0.5 seconds and then the calling fuction will resume.

    Another way of thinking about it is:

    I have a for loop that is rotating a square by 5 degrees everytime it loops, inorder to have it appear as an animation I need to insert a pause in the loop in order to slow down the animation.

    I know it can be done in many ways but the only way that I can do it for this movie is with the use of a single function because there is no animation is the entire movie, everything is code.


  4. #4
    Senior Member
    Join Date
    May 2001
    Location
    Sweden
    Posts
    197
    if(count!=6){
    blaha();
    blaha();
    count++
    }else{
    count=0;
    }

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