Solved

Changing a flash MP3 player's play list

Posted on 2010-08-17
5
283 Views
Last Modified: 2012-05-10
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
Comment
Question by:xoundboy
  • 2
5 Comments
 
LVL 1

Expert Comment

by:zimbix
Comment Utility
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
 
LVL 2

Author Comment

by:xoundboy
Comment Utility
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
 
LVL 2

Accepted Solution

by:
xoundboy earned 0 total points
Comment Utility
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
 
LVL 37

Expert Comment

by:CyanBlue
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Ajax not completing 11 74
Extract XML Data from using TSQL 5 28
Test ddwrt:UserLookup 1 15
XML & .net 5 16
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now