Solved

Changing a flash MP3 player's play list

Posted on 2010-08-17
5
284 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
ID: 33453993
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
ID: 33454355
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
ID: 33462164
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
ID: 34059424
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
No 'Access-Control-Allow-Origin' header is present... 4 115
API Soap Calls 4 91
Pass through dll 2 64
How can I   ajax html table  rows? 20 63
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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.

867 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

18 Experts available now in Live!

Get 1:1 Help Now