Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » need help with flash mp3 player flashvar


need help with flash mp3 player flashvar

Reply
  #1 (permalink)  
Old 06-06-11, 11:49 AM
twinrecords twinrecords is offline
New Member
 
Join Date: Jun 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
need help with flash mp3 player flashvar

I'm pretty new to AS, I've tried for 2 days to find the info on how to do this, but I am unable to.

I have a music community website, of course each member can upload their mp3 files, and a unique playlist.xml gets written for each member in their unique folder, the flash player lives in the root, and the xml lives in the members folder, so I am using the flashvars to call the proper xml, but I have absolutely no clue on how to code the as3 to pick up on the flashvars.

so here is what the object tage in the html looks like

Code:
<param name="movie" value="flplayer.swf?<?php print"$id/playlist.xml" ?>">
            <embed src="flplayer.swf?<?php print "$id/playlist.xml" ?>">
so obviously it's calling for the playlist.xml for the profile being viewed at that moment. (please let me know if I have done this part wrong)

now as I said, I have no idea how to code the action script to read this, I was told to use loaderinfo.parameters .

keep in mind that the player I am using is a prebuilt one, I have modified it to suit another application, but now I want to use the same player for this.

I can't find any info to help me figure out how and what to change, here is the as3 for frame 1

Actionscript Code:
  1. stop();
  2.  
  3. var myFormat:TextFormat = new TextFormat();
  4. myFormat.color = "0xFFFFFF";
  5.  
  6. list.setRendererStyle("textFormat", myFormat);
  7.  
  8.  
  9. var trackToPlay:String;
  10. var pausePosition:int = 0;
  11. var songURL:URLRequest;
  12. var isPlaying:Boolean = false;
  13. var i:uint;
  14.  
  15. var myXML:XML = new XML();
  16. var XML_URL:String = "mp3_playlist.xml";
  17. var myXMLURL:URLRequest = new URLRequest(XML_URL);
  18. var myLoader:URLLoader = new URLLoader(myXMLURL);
  19. myLoader.addEventListener("complete", xmlLoaded);
  20.  
  21. function xmlLoaded(event:Event):void {
  22.    
  23.     myXML = XML(myLoader.data);
  24.    var firstSong:String = myXML..Song.songTitle&#91;0];
  25.    var firstArtist:String = myXML..Song.songArtist&#91;0];
  26.    songURL = new URLRequest("mp3_files" + firstSong + ".mp3");
  27.    status_txt.text = "1. "+firstSong +" - "+firstArtist;
  28.          for each (var Song:XML in myXML..Song) {
  29.             
  30.              i++;
  31.              var songTitle:String = Song.songTitle.toString();
  32.              var songArtist:String = Song.songArtist.toString();
  33.              list.addItem( { label: i+". "+songTitle+" - "+songArtist, songString: songTitle, Artist: songArtist, songNum: i } );
  34.  
  35.          }
  36.          var myArray = new Array (0,0);
  37.          list.selectedIndices = myArray;
  38.          gotoAndStop(3);
  39.    
  40. }

and here is the song switching on frame 2

Actionscript Code:
  1. songURL = new URLRequest("mp3_files/" + trackToPlay + ".mp3");

I appreciate any help.
Reply With Quote
  #2 (permalink)  
Old 06-06-11, 03:51 PM
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
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
  #3 (permalink)  
Old 06-06-11, 06:36 PM
twinrecords twinrecords is offline
New Member
 
Join Date: Jun 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
thank you so much, I never found this, I tried and tried and tried
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
mp3 flash player in iframe prince13 HTML/XHTML/XML 8 07-24-09 07:11 PM
Dynamic Flash mp3 player:: mcrob Flash & ActionScript 11 10-26-06 01:53 PM
Encrypting XML files in Flash MP3 Player mrtunes Script Requests 0 05-12-06 01:04 PM


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