Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Edit:<br> Digging further, and with help from a colleague, apparently you can get good timing by using Sound. Try creating a new <code>Sound</code> object, playing it and then extract the <code>position</code> property from the returned <code>SoundChannel</code>-object. There are also some good ideas here: <a href="https://stackoverflow.com/questions/1858660/accurate-bpm-event-listener-in-as3">Stack Overflow - Accurate BPM event listener in AS3</a></p> <p><strike>I haven't tried this, but you could try using the <code>Date</code> class and extracting the <code>milliseconds</code> property from it, and use that. I'm unsure of how accurate that is, in comparison to getTimer, but it might be worth experimenting with. See the <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html" rel="nofollow noreferrer">AS3: Date documentation</a> for more information. Note however that the Date doc explicitly says this:</strike> <em>To compute relative time or time elapsed, see the getTimer() method in the flash.utils package.</em></p> <p>Other than that I think you're stuck with using getTimer, and the data it returns depends on your current OS/browser. You probably checked these links out already, otherwise they'll help explain the problem:</p> <p><a href="http://www.kaourantin.net/2006/05/frame-rates-in-flash-player.html" rel="nofollow noreferrer">Tinic Uro - Frame Rates in the Flash Player</a></p> <p><a href="https://stackoverflow.com/questions/1014009/as3-how-accurate-are-the-gettimer-method-and-the-timer-class">Stack Overflow - AS3: How accurate are the getTimer() method and the Timer class?</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload