Hi to all the Kirupa community!
I am looking for someone who is good at loading vars in and out of flash and also knows how to loop through arrays and extract data and assign it to variables. I have existing code for the project that i’m working on that us almost complete but i’m stuck on these points. If you feel you will be able to solve my problems and you want to earn some money in return then read on and i’ll give you the best overview i possibly can!
I run a small record label and wish to allow visitors to my site to select their top 5 favourite songs and play them on their web site (myspace etc) using a customised flash MP3 player - we’ll call it a “widget”.
They will use a flash interface on our site to preview all the tracks that are stored in our database and then create their own playlist of up to 5 tracks. When they have done this they click a button called “generate code” to create the HTML embed code - this is displayed in a dynamic text box and they can cut and paste it.
The embed code contains upto 5 vars that are passed into Flash using flash vars. These vars are ID numbers for the MP3 tracks they have chosen for their playlist. When they paste the embed code into their website the vars are passed into the flash widget and then sent back out to a PHP file stored on our server.
This PHP file connects to our mySQL database and selects the tracks with the same number as the vars. (The point of all this is so that the file locations of our MP3s are not revealed in the embed code).The PHP file then outputs these tracks in an XML format playlist format back to the MP3 widget which then plays the tracks.
Nearly all of this already works correctly:
- The flash vars pass correctly into flash from the html embed code
- The PHP script can be hard coded with 5 vars for testing and works correctly: it retreives the 5 tracks identified by their ID and outputs an XML format playlist
- The flash mp3 widget correctly receives the XML data and plays the tracks (BUT ONLY if the track ID vars are hard coded)
I think the problem is that i’m calling the same PHP file twice from flash - once to pass the vars out and the second time to create the XML playlist. Maybe it needs to be done in one go… I need someone to solve this problem please!
Problem 2:
I adapted a shopping cart to use as the playlist generator (i.e. you add to a track to a playlist rather than a product to a cart). All the info (Artist, Track, MP3 file name and ID) seems to be passed correctly into the user playlist. All i need to do is loop through the user playlist and retrieve the track ID number, assign it to 5 global variables which will form part of the embed code. The variables and the embed code already work i just need the playlist to pass the track ID to the
variables in the first place.
So that’s the 2 problems i need help with. If you are someone who knows about looping through arrays and passing vars in and out this should be easy for you so please leave you contact details and i’ll get back to you. Thanks a lot guys!