A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: wait?

  1. #1
    Amiga freak Ironclaw's Avatar
    Join Date
    Jan 2001
    Location
    Sweden
    Posts
    1,650

    wait?

    Is there a "wait" or something simular to use in scripts?... like:


    If enemy hitTest me
    wait 20 sec
    goto "die"


    ???

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    You can use getTimer() for these

    If enemy hitTest me
    starttime=getTimer()

    If getTimer()-starttime>20000
    goto "die"

  3. #3
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    :)

    I use the timer code

    onClipEvent(load){
    timer = 20;
    }
    onClipEvent(enterFrame){
    if(dead == true){
    if(timer>0){
    timer--;
    } else if(timer == 0){
    doubleDead = true;
    }
    }
    'How Art Is The Visual While We’re Artificial…'

    Mail & MSN
    My Not Finisched Page!
    Nick: SaphuA

  4. #4
    Amiga freak Ironclaw's Avatar
    Join Date
    Jan 2001
    Location
    Sweden
    Posts
    1,650
    Ok, thanks guys.

  5. #5
    Lunatic Baukereg's Avatar
    Join Date
    Nov 2000
    Location
    Lowlands
    Posts
    853
    mosterdfles_flash, you're way depends on the framerate. When I want to wait 20 sec. on a movie with a framerate of 30, I need to wait 20*30 frames (=600). So:

    onClipEvent(load){
    timer = 600;
    }

    Just wanted to say, before anyone makes any mistakes.

  6. #6
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    hehe

    Yeah I'm aware of that...
    'How Art Is The Visual While We’re Artificial…'

    Mail & MSN
    My Not Finisched Page!
    Nick: SaphuA

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