03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

my_sound.attachSound("logoff_id");<br />

my_sound.start();<br />

duration (Sound.duration property)<br />

public duration : Number [read-only]<br />

The duration of a sound, in milliseconds.<br />

Note: Flash Lite 2.0 supports this property for native Flash sound only. The sound formats<br />

that are specific to a host device are not supported.<br />

Example<br />

The following example loads a sound <strong>and</strong> displays the duration of the sound file in the<br />

Output panel. Add the following ActionScript to your FLA or AS file.<br />

var my_sound:Sound = new Sound();<br />

my_sound.onLoad = function(success:Boolean) {<br />

var totalSeconds:Number = this.duration/1000;<br />

trace(this.duration+" ms ("+Math.round(totalSeconds)+" seconds)");<br />

var minutes:Number = Math.floor(totalSeconds/60);<br />

var seconds = Math.floor(totalSeconds)%60;<br />

if (seconds

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!