Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Changing a flash MP3 player's play list

I've built a site to present a portfolio of music. Each separate music track has its own page with a built-in flash player that I made myself in AS3. An example of one of the pages can be seen here:

http://xoundboy.com/cfm/recDetailsP.cfm?recID=406

On each page load an XML file is dynamically written containing the filename of the appropriate MP3 file to play. The flash player then loads the XML file and subsequently loads the correct MP3 file.

I would now like to build a floating flash MP3 player that opens in a new window and replace the current built-in player with an "add to playlist" link. Clicking this link will append the current music track to the end of the floating player's playlist. The advantage of this would be that visitors can browse the site listening to music without interruption - currently browsing to a new page stops the current track from playing.

I'm fairly sure I can build most of this but being a Flash novice I'm not sure how I can push each new file into the playlist. Should I use ajax on the 'add to playlist' link to update the playlist.xml file on the server and then use some data pushing server program to push the new playlist back to the flash player? Or is there an easier way that doesn't require any serverside intervention I've no idea where to start with this? Any ideas greatly appreciated.
0
xoundboy
Asked:
xoundboy
  • 2
1 Solution
 
zimbixCommented:
You could use a frameset to keep the flash mp3 player object active at all times (it doesn't even have to be visible)
e.g.:
index.htm containing the frameset and including the following:
     -player.htm containing the player object
     -nav.htm where they can browse the rest of your website
0
 
xoundboyAuthor Commented:
thanks but I think you missed the point of the question... how would that solve the problem of the flash player knowing that a new file had been placed into the queue?

At the moment I can only think that I could use something like setinterval(100,checkForNewXML) in the actionscript to see whether the XML file had changed. This is going to mean lots of traffic between client and server.
0
 
xoundboyAuthor Commented:
I think I've found a client-side solution using Flash Shared Objects (Flash Cookies).

I'm making the 'add to playlist' button a flash button which reads the XML file and writes out the track name, artist name file name, etc to a flash shared object  which can then be re-read every half second by the floating player  using setinterval(500, reloadPlaylist). I reckon this is a lot simpler than sending stuff back to the server.
0
 
CyanBlueCommented:
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now