Onid3 (Sound.onid3 Handler) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

The following example loads a streaming sound:
var my_sound:Sound = new Sound();
my_sound.loadSound("song1.mp3", true);
See also
onLoad (Sound.onLoad handler)

onID3 (Sound.onID3 handler)

onID3 = function() {}
Invoked each time new ID3 data is available for an MP3 file that you load using
Sound.attachSound()
without polling. If both ID3 1.0 and ID3 2.0 tags are present in a file, this handler is called
twice.
Availability: ActionScript 1.0; Flash Lite 2.0
Example
The following example displays the ID3 properties of
DataGrid component. Add a DataGrid with the instance name
and add the following ActionScript to your FLA or AS file:
import mx.controls.gridclasses.DataGridColumn;
var id3_dg:mx.controls.DataGrid;
id3_dg.move(0, 0);
id3_dg.setSize(Stage.width, Stage.height);
var property_dgc:DataGridColumn = id3_dg.addColumn(new
DataGridColumn("property"));
property_dgc.width = 100;
property_dgc.headerText = "ID3 Property";
var value_dgc:DataGridColumn = id3_dg.addColumn(new
DataGridColumn("value"));
value_dgc.width = id3_dg._width-property_dgc.width;
value_dgc.headerText = "ID3 Value";
var my_sound:Sound = new Sound();
my_sound.onID3 = function() {
trace("onID3 called at "+getTimer()+" ms.");
for (var prop in this.id3) {
id3_dg.addItem({property:prop, value:this.id3[prop]});
}
};
my_sound.loadSound("song1.mp3", true);
610
ActionScript classes
or
Sound.loadSound()
. This handler provides access to ID3 data
to an instance of the
song1.mp3
id3_dg
to your document,

Advertisement

Table of Contents
loading

Table of Contents