A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: timers and the sort

  1. #1
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215

    timers and the sort

    uh hey guys,

    just wanted to know
    how to add a timer-based actions,

    like say, if it is already 5 seconds on a current frame,
    then go and play on the next

    can any1 help?

    thnx a bunches!!!
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

  2. #2
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    I've used the simplest timer movie clip of all for stuff like that, where you want to go from frame to frame, that holds say,images. I just made a clip that had a stop in frame 1, then enough frames to eat up 5 seconds at the movie frame rate, then in the last frame, code to make the timeline jump to nextFrame(); In the frames of the timeline you want to use it in, add this to each frame,

    _root.timerMc.play();

    Simple and dumb, but dang me if it doesn't work every time. I did it this way, because I found that coaded timer didn't always work as expected.

  3. #3
    The next Squaresoft
    Join Date
    Sep 2004
    Location
    Zanarkand
    Posts
    215
    haha, ok

    but i in my case, i would need the coded timer since
    it goes like this,

    I have a character, now when you press jump,
    it will go to a frame where he is ready to jump

    now, there is a new button there called "jump now"
    everytime you press it, he will jump

    but within that, i want to have a set time before
    it will go back to the frame where it sez "jump"

    well, i could be wrong about not using your style,
    but i think im more comfortable with AS
    (not that im good at it)

    anyway, thnx a bunchez!
    "Are those gummy worms? Can I have some?"

    "Nevermind, I just saw one move by itself..."

  4. #4
    x2i GingaNinja's Avatar
    Join Date
    Feb 2004
    Location
    England
    Posts
    217
    Here is one way:

    Paste it into the main frame to test it

    Code:
    function doSomething() {
    	trace("Tada");
    }
    setInterval(doSomething, 5000);

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