03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

onID3 (Sound.onID3 h<strong>and</strong>ler)<br />

onID3 = function() {}<br />

Invoked each time new ID3 data is available for an MP3 file that you load using<br />

Sound.attachSound() or Sound.loadSound(). This h<strong>and</strong>ler provides access to ID3 data<br />

without polling. If both ID3 1.0 <strong>and</strong> ID3 <strong>2.0</strong> tags are present in a file, this h<strong>and</strong>ler is called<br />

twice.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7<br />

Example<br />

The following example outputs the ID3 properties of the song1.mp3 file (which is in the<br />

same directory as the SWF file):<br />

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

my_sound.onID3 = function() {<br />

for (var prop in this.id3) {<br />

trace(prop + ": " + this.id3[prop])<br />

}<br />

};<br />

my_sound.loadSound("song1.mp3", true);<br />

See also<br />

attachSound (Sound.attachSound method), id3 (Sound.id3 property), loadSound<br />

(Sound.loadSound method)<br />

onLoad (Sound.onLoad h<strong>and</strong>ler)<br />

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

Invoked automatically when a sound loads. You must create a function that executes when the<br />

this h<strong>and</strong>ler is invoked. You can use either an anonymous function or a named function (for<br />

an example of each, see Sound.onSoundComplete). You should define this h<strong>and</strong>ler before you<br />

call mySound.loadSound().<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 6<br />

Parameters<br />

success:Boolean - A Boolean value of true if my_sound has been loaded successfully, false<br />

otherwise.<br />

1126 <strong>ActionScript</strong> classes

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

Saved successfully!

Ooh no, something went wrong!