Jump to content


Mp3 player add on


  • You cannot reply to this topic
1 reply to this topic

#1 punstc

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 17 August 2007 - 01:27 AM

I've gone through the mp3 tutorials and modified the final result for what i'm looking for. one thing i would like though is to be able to add another attribute in for a clickable button that links to another page that would have lyrics.

so my xml would look like this i believe or something close

<song name ="Test Track 4" band ="Band4" file="test4.mp3" lyrics="testlyrics.html" />

basically so it adds another button in after the track listing so you can click and view the lyrics that would be on a separate page. I don't quite understand how it all draws together in flash actionscript and how to put the lyrics attribute on another button.

Is there any possible way of doing this?

i'll attach my fla and such in a zip also.

thanks a bunch

Attached File  mp3_player.zip   25.67K   194 downloadsjake

#2 punstc

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 17 August 2007 - 08:08 PM

i've managed to get both buttons up problem i'm running into know is getting my view lyrics button to have the link on it.

i tried writing an on release getURL but that isnt working any help?

heres the code

stop();
title_txt.autoSize = "left";
timeDisplay_txt.autoSize = "left";
toolTip._visible = false;
var amountLoaded:Number;
var duration:Number;

playlist = new XML();
playlist.ignoreWhite = true;
playlist.onLoad = function(success) {
	if (success) {
		_global.songname = [];
		_global.songband = [];
		_global.songfile = [];
		_global.songlyrics = [];
		for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
		_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
		_global.songband[i] = playlist.firstChild.childNodes[i].attributes.band;
		_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
		_global.songlyrics[i] = playlist.firstChild.childNodes[i].attributes.lyrics;
		attachMovie("butTemp","but"+i,i+50);
		eval("but"+i).id=1;
		_root["but"+i]._x = 60;
		_root["but"+i]._y = 40 + (i*15);
		_root["but"+i].but_txt.text = songname[i];
		if (i >= 25){
			_root["but"+i]._x = 60;
			_root["but"+i]._y = -111 + (i*15);
		}
		attachMovie("butlyrics","butt"+i,i+5);
		eval("butt"+i).id=1;
		_root["butt"+i]._x = 445;
		_root["butt"+i]._y = 40 + (i*15);
		_root["butt"+i].but_txt.text = "view lyrics";
		
		
		_root["but"+i].onRelease = function(){
			clearInterval(timeInterval);
			_root.timeDisplay_txt.text = "00:00/00:00";
			_root.sound_mc.songStarter(songfile[this.id]);
		}

//**this is where i really dont know whats going on or really what i'm doing

		_root["butt"+i].onRelease = function(){
			getURL(_global.songlyrics[i] = playlist.firstChild.childNodes[i].attributes.lyrics, "_blank");

		}
	}
	}
	_root.createEmptyMovieClip("sound_mc", 1);
	_global.song_nr = random(songfile.length);
	_root.sound_mc.songStarter(songfile[song_nr]);
};

heres my new project

Attached File  Archive.zip   9.68K   162 downloads

thanks in advance

Jake





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users