Flash and ID3 tag support

MSUman4

OSNN Junior Addict
Joined
6 Dec 2001
Messages
14
I'm very novice when it comes to Flash, so bare with me. I'm trying to pull the ID3 tag information from an external mp3. I pulled this code directly from Macromedia's web site. My source code is below:

myTrack = new Sound();
function Music(){
myTrack.start();
if((myTrack.getBytesLoaded() == myTrack.getBytesTotal()) && myTrack.duration > 0){
tf.text += "Title = " + myTrack.id3.songname +"." + newline;
tf.text += "Artist = " + myTrack.id3.artist +"." + newline;
clearInterval (poll);
}
}
myTrack.loadSound("song.mp3", false);
poll = setInterval(Music, 1000);


It correctly pulls the two ID3 fields I want and I've tested them by using the "trace()" function. The problem I'm having is outputing the information to a dynamic text box. I want to have a seperate text box for the title of the song and for the artist of the song. Using this code, how do I do that? Please be very descriptive because I'm new at this. Thanks in advance!
 
Well, knowing nothing about the Flash script language, I'd say you could do this. Create tho boxes called titleBox and artistBox. Then use this code.

Code:
myTrack = new Sound();
function Music(){
  myTrack.start();
  if((myTrack.getBytesLoaded() == myTrack.getBytesTotal()) && myTrack.duration > 0){
    titleBox.text = myTrack.id3.songname;
    artistBox.text = myTrack.id3.artist;
    clearInterval (poll);
  }
}
myTrack.loadSound("song.mp3", false);
poll = setInterval(Music, 1000);
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back