Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Changing a flash MP3 player's play list

Posted on 2010-08-17
5
Medium Priority
?
292 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

722 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