Skip navigation
I_am_the_real_Z
Currently Being Moderated

I've tried every online tutorial for timer.delay + experimented... how to make it work in this sitch

May 31, 2012 10:01 PM

Tags: #flash #3.0 #actionscript #ac3 #timer #timer.delay

Hey,

I've read literally every single timer.delay tutorial I could find online, on youtube, the official documentation, tons of posts on this forum, etc. What I am trying to say is I looked everywhere before posting for help.

 

I have a timer running. It runs throughout the game. I need to modify the speed of that timer when a player either hits a certain second(won't work, because the timer is already running) or when someone gets a certain score(can't get it to work, because timer is running).... so my question is how do I get timer.delay to work when the timer is running throughout the entire game. I tried to control the delay by when someone gets a point, but that didn't work either. I am using a trace statement so I see the seconds and the timer speed. the code looks something like

 

randomvariable = new Timer(2000,8);

timer.addEventListener(MouseEvent.CLICK, loop);

timer.start();

function loop

{

// my looping code here

}

What I posted is psuedo code.

 

 

Any ideas on how to make the timer go faster without delay, since I can't get delay to work under the circumstances I explained? Or is there a work around that I don't know about? I will try to give back to the forums by answering other questions. Oh, I am running this on the timeline, not in a .as file. Thanks so much for your help!

 
Replies
  • Currently Being Moderated
    Jun 1, 2012 4:22 AM   in reply to I_am_the_real_Z

    What is the problem with changing the Timer's ' delay ' property while it is running?  It should work (does for me).

     

    "If you set the delay interval while the timer is running, the timer will restart at the same repeatCount iteration."

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 1, 2012 5:53 AM   in reply to I_am_the_real_Z

    The only idea I have is that you are doing it wrong.  I tested the Timer delay varying and it works fine, and reports the correct changed delay values.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 2, 2012 4:09 AM   in reply to I_am_the_real_Z

    You're welcome

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points