A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Hey! Give me a break!

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    28

    Hey! Give me a break!

    Hi Folkz

    My problem is:

    just want to know what code I can use for the actionscript stop for time and then continue

    Like this

    Command command command;
    wait some seconds;
    Command command command;


    is there a sintax to give this break???

    tkxxx

    []s

  2. #2
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    What you're looking for is setInterval and there is a nice sticky post about it at the top of this forum.

    The method you're currently describing of waiting for a few seconds won't work, because actionscript scripts are supposed to execute very quickly between drawing frames.

    So instead, the way it's done is you use setInterval, and you say "execute these lines of code XXX seconds in the future".

    code:

    myFutureFunction = function()
    {
    // setInterval will repeat every XX seconds if we don't clear it here...
    clearInterval(handle);

    // future lines of code go here...
    }

    // execute some code here...

    // Then use setInterval to schedule myFutureFunction 4 seconds in the future
    handle = setInterval(myFutureFunction, 4*1000);



  3. #3
    Flasher_man
    Join Date
    Jul 2003
    Location
    USA
    Posts
    49

    wow

    err sry wrong file
    Attached Files Attached Files
    ;p

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