2 Replies Latest reply on Feb 28, 2007 4:06 AM by shikozel

    Flash MP3 Player "Most Played" list?

      Hello, all,

      I hope this is the right forum for this. I have built a Flash-based MP3 player for a client that gets song information from an XML file. It works fine. No problems there.

      However, now that my client's work has expanded, he would like to have an automatically updating "most played" list displayed on the main page of his site. I have done a bunch of reading and research the last couple of days, and I am guessing (since I am pretty new to Flash) that it is possible to write the ActionScript so that it can track the number of plays and send the data to somewhere to be displayed on an HTML page inside a CSS div. Am I right about that? (Question 1)

      (Question 2): Assuming that it is possible to extract the data of the ten most played songs from this Flash MP3 player, how, exactly, would I go about it?

      (Question 3): Assuming that it is possible to get the data from the Flash player, where, exactly would the data be sent? Can it be sent directly to the CSS div? A JavaScript? Another XML file? If any or all of these are possible, how do I do it?

      I really appreciate any help you can give me. I can give more information if needed (not sure, right now, what anyone would need). I've been looking for a solution to this problem for four days, and I really need some help.

      Thanks so much!
        • 1. Re: Flash MP3 Player "Most Played" list?
          There are more than one way to store data from flash......

          1. it could be saved in an XMl file through the help of php or other server side scripts.....
          2. one could use flash's own sharedObject data to save too......

          this could be done by updating an xml whenever someone clicks a song......and the highest number of clicks could be stored in that xml ...... which later will help to build the most played list.....

          this is just way other might prefer some other way....

          • 2. Flash MP3 Player "Most Played" list?
            shikozel Level 1
            you will need the help of any server side programming script to do what you are looking for. It could be php, asp .net ( I think javascript can do it too). The reason for that is because flash can only recieve data but can not write data without a help of another program.

            so this is the idea:
            you will need to keep a hit counter for every song that in your xml. you can add an attribute "hitsCounter" to each xml node that get increased each time the song play. the procedure will be
            1. song X got play
            2. flash send a unique variable to a server side script that indicate which play got played ( could be songID or song name). you will send this variable from flash with sendAndLoad command
            3. in the server side page you read this variable and increase th e hitsCounter of X song.

            This is how you keep track of your counters. now, everytime your HTML page load you'll need to access the xml with server side script read all the counters and display a list of the most popular songs where the highest "hitsCounter" will be first of the list.

            I hope this helps