In Flash MX you have the capability to load an external mp3 sound file into a flash movie using the Sound.loadSound() method. In the latest release of the Flash 6 Player it is possible to access the ID3 tags embedded in an mp3 encoded file. Unfortuneatley you cannot access the ID3 tags in an mp3 file until it has *fully* loaded, this is fine when you are using the Sound.attachSound() method but it causes problems when you are loading an external sound into the player…
When an external sound has fully loaded into the player, you have to wait one frame before you can retrieve the values of the ID3 tags in the mp3. This means that you cannot access the ID3 tags inside of the Sound objects onLoad event handler. Here is some code that demonstrates how to access the ID3 tags from an external mp3 file loaded into the player using the Sound.loadSound() method:
//create an onEnterFrame event with
//listener capabilities
ASBroadcaster.initialize(Movieclip);
_root.createEmptyMovieClip("__enterFrame",-9799);
__enterFrame.onEnterFrame=function(){
Movieclip.broadcastMessage("onEnterFrame");
}
mysound=new Sound(this);
mysound.loadSound("an_mp3.mp3");
mysound.onLoad=function(){
   Movieclip.addListener(this);
   //redefine the onLoad event handler
   this.onLoad=function(){
    //iterate over all the id3 tags
    //and trace their names and values
    for(var i in this.id3){
     trace(i+":"+this.id3[i]);
    }
  }
   //when the onEnterFrame broadcast
   //is recieved, call the newly defined
   //onLoad evet handler and then
   //stop listening to the broadcast
   this.onEnterFrame=function(){
    this.onLoad();
    Movieclip.removeListener(this);
   delete this.onEnterFrame;
   }
}
The same is true, for two other properties of the sound object, Sound.duration and Sound.position, you cannot access these properties until one frame after an external sound file has fully loaded, you can use the same process outlined above to retrieve the value of these two properties.
Guy Watson (or FlashGuru as he is also known) has been an active, well
recognized figure in the Flash community for over four years,
supporting the community with tutorials, source files, moderating the
Flashkit forums, and running his own Flash resource Web site,
FlashGuru’s MX 101. Guy was one of two developers who created the ever
popular, award winning zoom interface for Relevare and now runs his
own company, FlashGuru LTD, which builds Flash Games & Applications
for clients such as Comic Relief, Egg and Channel 4.