0 Replies Latest reply on Nov 8, 2007 12:18 AM by alejandro52

    Event.Id3 listener dispatch two times

    alejandro52
      I'm trying to get the id3 tags of a song and when i load the sound the id3 triggers twice.Here is the code
      quote:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="{loadmp3()}">
      <mx:Script>
      <![CDATA[
      private var mp3s:Sound;
      private var aRequest:URLRequest;

      private function loadmp3():void{
      aRequest = new URLRequest("Wake.mp3");
      mp3s = new Sound();
      mp3s.load(aRequest);
      trace("try load");
      mp3s.addEventListener(Event.ID3,getID3);
      }

      private function getID3(event:Event):void{
      trace(event.target.id3.artist);
      }

      ]]>
      </mx:Script>
      </mx:WindowedApplication>
      //Output
      tryload
      Linkin Park
      Linkin Park