I have a custom mp3 player made from flash MX. And I am looking to load mp3’s into it, but the mp3 link is in an html button. How would I load an mp3 into flash that is trigered from an html button?
Erm… I don’t think you can do that :-\
You could do it in Flash, and dynamically load your sound
When you set an html link to a mp3 it will call your defult mp3 player and play the mp3. Well, what if my Flash mp3 player is embeded in the same html page that is calling the mp3.
You load an mp3 dynamically into the flash player, not into your computer (well it loads into your computer to play in the flash movie, but you get my point)
Check this out on how to dynamically load sound, it is at the bottom…
mySound = new Sound();
mySound.loadSound(“music.mp3”,true);
Looks great but the information of what mp3 to play is in the html button. So I need a way to pass the information to flash from the html button. Is there any way to talk to flash from an outside source?
How about java or pull values from page url, Anything
:*(
Ok say some clicks on a button to load an mp3. What if the page refreash and has the same url but with a quarry string attached to it. Could I then pass the url quarry data to flash?
I don’t think the query string thing would work.
Nor Java.
I don’t think it is possible to communicate with Flash outside of Flash. The best best would be to use loadVariables.
That I could think of right now at least.
I don’t see why you can’t just have your buttons in Flash though, it would make it so much easier :-\
I’m with you on that, but the buttons on the html page are dynamically generated, there for I would have to dynamically generate them in flash.:x
Thanks, I am going to go after the url sting thing and see what happens.
I am sorry if I am not much help, I am in a rush… I probably won’t be around much for the next day or two
If you would please take a look at this link.
http://64.225.103.218/voices_frame.php3?voice_id=1&type=All&sex=Male
How do they do this…
Bill
I think that might actually be a different .swf file for each. If you view the source it looks like this…
src="MP3player2.swf' +document.location.search+' " '
Which is like saying… the +document.location.search is there to add onto the file name and load a different file :-\
I believe.
flash can communicate with its outside in a couple of ways.
you can load the outputstring of a phpscript into flash… if this looks like: var1=bla&var2=blabla, these variables will be available in flash:
loadVariablesNum(phpscript.php, _root ,“GET”);
and flash can be addressed from outside using javascript… you could try something like this (this script works on IE)…
[ example script ]
<script language=javascript1.2>
function jump(frame_no) { document.soundplayer.GotoFrame(frame_no); }
</script>
<body>
[ the flash object ]
<object id=“soundplayer” classid="clsid:D27CDB6…
[ the html button (or link) ]
<button onclick=“javascript:jump(1);”>
but i can’t think of a way how to pass a variable to flash without flash invoking an outside-script…