Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » Dynamic mp3 Player and txt files


Dynamic mp3 Player and txt files

Reply
  #1 (permalink)  
Old 10-14-06, 04:55 PM
mcrob mcrob is offline
Coding Addict
 
Join Date: Jul 2004
Posts: 266
Thanks: 0
Thanked 0 Times in 0 Posts
Dynamic mp3 Player and txt files

Hey there I am looking for an open source fla flash file, where I can add a logo and among other things to the design of the content and I am looking for an dynamic flash mp3 player where all you need to do is edit the .txt file. The reason for a .txt file and not an XML file is because what I wish to do is, when the user decides to listen to a specific track, it will pass on the ID variable to the next page (I am doing an PHP website) and from there it will bring up the information read from the Database. Does anyone know where I can download the OS dynamic Flash mp3 player?
Reply With Quote
  #2 (permalink)  
Old 10-14-06, 06:21 PM
mcrob mcrob is offline
Coding Addict
 
Join Date: Jul 2004
Posts: 266
Thanks: 0
Thanked 0 Times in 0 Posts
Almost found a solution to the problem

Ok I am very close to finding the solution to my problem.

>> Mp3player.swf
>> Mp3passvariable.php

Basically I found a flash script where it will play an mp3 track as long as the mp3 is stored in the same directory as the flash file. In the mp3passvariable.php that is where it will read from the mysql database so it will end up being like flyingaway.mp3 (When the user clicks on a track, it will pass the ID variable to the next page and load whatever information was stored in the database)

In the Mp3passvariable.php it will have this
<?php print "&mp3=$row_Recordset1[mp3]"; ?>

Now in the flash I have this code
Code:
var musicPlays:Boolean = false;
var loopTune:Sound = new Sound();
loopTune.onLoad = function(success:Boolean) {
	if (success) {
		loopTune.start(0, 999);
		musicPlays = true;
		_root.musicPlayer.gotoAndStop("playing");
	}
};
loopTune.loadSound("cooltune.mp3", false);
musicPlayer.playStop.onPress = function ():Void {
	if (musicPlays) {
		this._parent.gotoAndStop("stopped");
		loopTune.stop();
		musicPlays = false;
	} else {
		this._parent.gotoAndStop("playing");
		loopTune.start(0, 999);
		musicPlays = true;
	}
};
You'll see "cooltune.mp3". What I want to do is insert a variable where it shows cooltune.mp3 so everytime a user clicks on a mp3 track, it will load that mp3 filename into flash and play the track. Any idea on how to do this. This is probably simple for the advanced flash programmers.

Last edited by nico_swd; 10-14-06 at 06:57 PM.
Reply With Quote
  #3 (permalink)  
Old 10-15-06, 03:57 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
i'ld say: store all songs in a lisbox, and then when the user hits on of the songs, trigger a function wich will load the selected song.

i've never worked with the listbox before, so i can't help you with the "hit" function, but if you check out the livedocs, you'll find how to do so

Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 06:29 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.