hi all
I have been trying to read id3 tags off an mp3 file but have been unable to do so. My code fires the ID3 handler unction but when at that moment i try to parse the id3 array of the sound object, it comes up as 0. its really frustrating. Is it something i am doing wrong ? Here is my code :
<?xml version="1.0" encoding="utf-8"?>
<mx:Script>
<![CDATA[
import flash.util.trace;
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.*;
private var song:SoundChannel;
private var soundFactory:Sound;
public function playSong(url) {
var request:URLRequest = new URLRequest(url);
soundFactory = new Sound();
soundFactory.addEventListener(Event.ID3, id3Handler);
var sc = new SoundLoaderContext(15000,true);
soundFactory.load(request, sc);
}
private function id3Handler(event:Event):void {
trace(event.currentTarget.id3.length); //comes up 0
}
]]>
</mx:Script>
<mx:Button label="play" click="playSong('worldwide_suicide2.mp3')" x="105" y="202"/>
<mx:TextArea x="105" y="30" width="165" height="164" id="txt"/>
<mx:Button x="205" y="202" label="check" click="{this.txt.text+= 'check' + String(this.soundFactory.id3.TIT1+'\n')}"/>
</mx:Application>
Any help would be appreciated
thanks
arpit
I have been trying to read id3 tags off an mp3 file but have been unable to do so. My code fires the ID3 handler unction but when at that moment i try to parse the id3 array of the sound object, it comes up as 0. its really frustrating. Is it something i am doing wrong ? Here is my code :
<?xml version="1.0" encoding="utf-8"?>
<mx:Script>
<![CDATA[
import flash.util.trace;
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.events.*;
private var song:SoundChannel;
private var soundFactory:Sound;
public function playSong(url) {
var request:URLRequest = new URLRequest(url);
soundFactory = new Sound();
soundFactory.addEventListener(Event.ID3, id3Handler);
var sc = new SoundLoaderContext(15000,true);
soundFactory.load(request, sc);
}
private function id3Handler(event:Event):void {
trace(event.currentTarget.id3.length); //comes up 0
}
]]>
</mx:Script>
<mx:Button label="play" click="playSong('worldwide_suicide2.mp3')" x="105" y="202"/>
<mx:TextArea x="105" y="30" width="165" height="164" id="txt"/>
<mx:Button x="205" y="202" label="check" click="{this.txt.text+= 'check' + String(this.soundFactory.id3.TIT1+'\n')}"/>
</mx:Application>
Any help would be appreciated
thanks
arpit
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.