Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Difference between Timer.stop() and Timer.reset()?

New Here ,
Aug 27, 2008 Aug 27, 2008
Hello,

What is the difference between Timer.stop() and Timer.reset() functions because it seems that the 2 functions do the same thing? I image Timer.stop() to stop the timer and when Timer.start() is called the timer starts from where it stopped. For example, if I have a 3 sec. timer (3000 ms). If I stop the timer after 2.5 sec. and start the timer again, I would expect the timer to expire/trip within .5 sec. Is this a correct assumption? Code is attached below.

Thanks,

Nilang
TOPICS
ActionScript
637
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 27, 2008 Aug 27, 2008
LATEST
Hello,

Here is a better description of what I am trying to do and the problem I encountered.

I am developing an application that plays multiple sound files at different time offsets. For example, snd1 starts at time offset 0 and snd2 starts at time offset 5000 ms (5 sec). I have created a timer for each sound file and enabled the handlers via addEventListener() function. I encounter a problem after the timer has been stopped (Stop button pressed) before the timer expires. When the user presses the Play Button, the timer seems to be reset because the onTimerComplete() function is triggered after an additional 5000 ms (5 sec). Is this normal behavior? If this is not the correct behavior, is there a workaround Any help would be appreciated.

I have created a small application in Flash CS3 that depicts the problem with just a single sound file. I have Flash Player 9.0.124.0 installed. Sample code is above.


Thanks,

Nilang
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines