dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: timed events

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    102

    timed events

    I have an event that i want to take place every 10 seconds. I have gotten it where it will happen on 10 but i need to reset the counter. this is what i have so far.

    startTime = getTimer();
    elapsedtime = Math.round(startTime/1000);

    if (elapsedtime == "10") {
    square.nextFrame();
    }

    How would i make this so that the action is preformed every 10sec not just on the 10sec mark?

  2. #2
    Member
    Join Date
    Jul 2002
    Location
    Hannover, Germany
    Posts
    99
    Gimme some more informations. Is it a movieClip or is it an Object via "new Object()" ???. If so you can start a countDown for yuor Object, with sending a message and a following reset on reaching your 10 sec mark .

  3. #3
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    onClipEvent(enterFrame) {
    startTime = getTimer();
    elapsedtime = Math.round(startTime/1000);

    if (elapsedtime > 0 && elapsedTime % 10 == 0) {
    square.nextFrame();
    }
    }

    elapsedTime % 10 is the remainder found by dividing elpasedTime by 10, so this will be zero when elapsedTime is 10 (1 remainder 0), 20 (2 remainder zero), 30 etc...

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