Array
ID3 tags in Sound [Archive] - FlashMove Forum

PDA

View Full Version : ID3 tags in Sound


carolien
11-13-2004, 08:28 PM
Hello everybody,

I'm writing kind of a media player to play music (mp3) in Flash. I want to show the artist and the title of the mp3 that is kept in the ID3 tags of the mp3. I have no problem importing and playing the mp3, but I 'm still not able to get the ID3 tag information of the mp3.

I have only one frame and this is all the actionscript code within this frame. The mp3 plays, but I do not see the ID3 info.
firstSound = new Sound();
firstSound.onID3 = function() {
for (var prop in my_sound.id3) {
trace(prop+" : "+firstSound.id3[prop]);
}
};
firstSound.attachSound("firstSound02");
firstSound.start();
stop();Do you guys know what could be wrong ?

Scottae
11-14-2004, 04:57 PM
Looks like you're referring to two different sounds within the onID3 method:
[list=1]
firstSound
my_sound
[/list=1] Try using the this (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary806.html) keyword instead: var firstSound:Sound = new Sound(this);

firstSound.onID3 = function() {
for (var prop in this.id3) {
trace(prop+" : "+this.id3[prop]);
}
};

firstSound.attachSound("firstSound02");

stop();

carolien
11-21-2004, 09:36 PM
I just want to say that the problems of retrieving the ID3 tags are solved.
I just used the "old" id3 properties names, like "artist", "songname" and that worked.

thanks and see you