PDA

View Full Version : Using Javascript to tell a Flash player which mp3 to play?


csteele
08-03-2008, 07:54 PM
Hello everyone! I wasn't sure whether to put this in the Javascript or Flash section, but it seemed to me like the type of thing that would be more complicated on the Flash side.

What I'd like to do, is upload a bunch of mp3s onto a website, add links to the mp3s on a page (on the same page as the flash player), and use Javascript to load the mp3 that a user clicks into Flash.

An example was here:
http://nopiano.com/audio.html
but it appears that the site is down.

Basically it would look like this:

[FLASH PLAYER SWF]

(html link to mp3)
(html link to mp3)
...

And you click the links to have the flash player load the mp3s, but without using a different flash player every time.

gnomeontherun
08-05-2008, 08:15 PM
Use XML to load the specified songs into the player. You can also use JS to send variables to Flash so it can switch songs without reloading the page.