vendredi 24 mars 2017

SWF file has timer that runs faster in debug player than release player (Adobe Animate, AS3)

I have an interactive animation that consists of a button and some lights that are lit in a sequence. The animation also has a timer that shows the passage of time to illustrate the interval between light transitions, so the user knows how much time has passed between each transition in the sequence (it took x amount of time to go from light 'a' to light 'b'). The button controls the speed.

I implemented the timer using the Timer class in AS3:

var MyTimer:Timer = new Timer(1);

Which means the timer should fire every millisecond.

Now, I am aware the this is nowhere near accurate, due to frame rate (24fps) and the fact that it has to run the code inside the handler function. But I am not going for an accurate timer, in fact I do need it to go slower so the user can see the time between transitions, a scaled/slowed timer if you will. The current time is displayed in a dynamic text field.

As is, when using the debug player in Adobe Animate, the speed of the timer runs at about 1/10th normal speed, taking about 10 seconds to show that a second has passed, which incidentally is great for my purposes. However, this animation will be used in a PDF, in which case, a release player of Flash will be used; and in the release version, the timer appears to be about half as fast, about 1/20th the speed, taking about 20 or more seconds to show that a second has passed.

I'm not sure why this is. How do I get the swf file to be played so that the timer behaves the same in both the debug and release versions of the Flash Player?

I have tried unticking 'Permit debugging' and ticking 'Omit trace statements' (and every combination of un/tick) in the Publish Settings as well as all the Hardware acceleration options.

I've also implemented a FPS counter as suggested here by user 'kglad':

published swf file is a lot slower than the 'test' mode?

But both debug and release versions show the FPS at 23-24.'kglad' gives the last reply in the thread as "the debug players are slower than the non-debug players". I'm not sure what he meant by this as this seems to be the opposite problem that me and the OP of that thread are having, unless s/he meant using the players in a browser.


TL;DR

How do I get a timer to behave the same in both the debug and release version of the Flash player?

Thanks in advance for any suggestions.

Aucun commentaire:

Enregistrer un commentaire