A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [RESOLVED] function question

  1. #1
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588

    [RESOLVED] function question

    how do i tell a function to wait a few seconds before executing?

  2. #2

  3. #3
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    yeah i know that but it causes it to execute every three seconds....I only want it to wait 3 seconds execute then stop executing

  4. #4
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    use clearInterval in the function to stop it executing more than once...
    code:

    myFunction=function(){
    trace("myfunction called");
    clearInterval(myInterval);
    }

    myInterval=setInterval(this,"myFunction",3000);


    K.

  5. #5
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    ok i see i can use clear Interval to stop the interval but i have no idea how to write the setInterval and clearInterval....could you give me an example?

  6. #6
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    nevermind you already did it

  7. #7
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    ok that seems to work but how do I know the interval is no longer executing?

  8. #8
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    never mind i figured out a way to see if it stops the Interval....thanks for your time.

  9. #9
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    that worked

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