Groups | Blog | Home
all groups > flash actionscript > october 2006 >

flash actionscript : mp3 name


jonnybennett
10/19/2006 5:58:04 PM
When you play an mp3 in a player, whatever the mp3 filename it contains extra
info, like the songs title, maybe album details etc...
How do you extract these details from the mp3 into my swf, if indeed it is
possible, if infact what i am saying is correct. Thanks J.
derobinson
10/19/2006 6:20:28 PM
Yes it is (with some caveats, but...). Here's the LiveDocs to get you started:

http://livedocs.macromedia.com/flash/8/main/00000676.html

Good luck!
jonnybennett
10/19/2006 11:27:20 PM
Hello, thanks for the resoponse, I had looked at the livedocs info whoich
solved part of my problem, however I am now only experiencing a problem with
the songname.

mySound.id3.artist
mySound.id3.songname

flash does not seem to recognise 'songname' for some reason. If you paste it
into your actionscript songname does not turn blue, like artist. However all
the docs say that it should be songname... any one any ideas?
jonnybennett
10/19/2006 11:43:24 PM
kglad
10/20/2006 2:47:29 AM
i don't see a songname property. try:

jonnybennett
10/20/2006 3:02:21 AM
Thanks kglad for articulating what I tried to with the words... 'it doesn't
turn blue!'.
However although it don't turn blue... mySound.id3.songname.. does appear to
work, and songtitle doesn't.... I'm not saying you are wrong, as this would be
like argueing with god, although I am not a religous man, i wouldn't want to
upset you or the big man. Thanks anyway!.
kglad
10/20/2006 3:31:52 AM
you're correct. i'm not sure why flash suggests songtitle is an id3 property,
but that appears to be an error. songname and TIT2 should both return the
song's name.

p.s. i'm not god (my wife bosses me around and surely that wouldn't happen if
i were in charge) and i'm always happy to learn something new.
Machiavelli
10/20/2006 12:26:01 PM
I tried doing the whole id3 tag thing the way you guys are talking
about and the problem I was having was that some information I wanted
available without having to load the song which you need to do to get
the id3 tag data.
What I've done differently is obtain the id3 tag data using an aspx
page that returns all the data as an xml file. I point flash at this
aspx page and it parses the xml to get all the information I want
without having to load each song individually.

the current iteration of this project is at:
www.iamnotadeadman.com/audio

if you care. the track titles are generated off the id3 songname, not
the file name.

[quoted text, click to view]
jonnybennett
10/20/2006 4:01:32 PM
Perhaps you're wife is god?
The search for god was probably not what macromedia or adobe had in mind for
these forums, so I will stop, I have a slight further problem and that is that
the Id3 tags are being called twice, at the begining and end of the song.

mySound.onID3 = function():Void {
tester.text += "Artist:" + mySound.id3.artist + "\n";
tester.text += "Title:" + mySound.id3.songname + "\n";
// i need to delete the functon here so that it doesn't get called twice.
}

onID3 is being called twice, as my output for tester.text is being repeated. I
think this is becuase 'if you have ID3 V2 and ID3 V1, on will be called twice.
ID3 V2 is at the start of the song. So the first onID3 will be ID3 V2. ID3 V1
is at the end of the song.'
Therefore how could I stop this onID3 function after the ID3V2 tags at the
start are called.
I can't delete mySound, as that also holds the sound? is it possible to delete
the function only... delete mySound.onID3() ?
jonnybennett
10/20/2006 4:11:20 PM
Unless anyone can think of a better way...

passOne=1;
mySound.onID3 = function():Void {
if (passOne==1){
tester.text += "Artist:" + mySound.id3.artist + "\n";
tester.text += "Title:" + mySound.id3.songname + "\n";}
delete passOne;}
AddThis Social Bookmark Button