# Loadsound html link

**URL:** https://forum.kirupa.com/t/loadsound-html-link/7678
**Category:** Uncategorized
**Created:** [November 5, 2002, 6:50pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678 "2002-11-05T18:50:33Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![waffe](https://avatars.discourse-cdn.com/v4/letter/w/c37758/32.png) [@waffe](https://forum.kirupa.com/u/waffe)
#### Post date: [November 5, 2002, 6:50pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/1 "2002-11-05T18:50:33Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 6:52pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/2 "2002-11-05T18:52:21Z")

</div>

Erm… I don’t think you can do that :-\

You could do it in Flash, and dynamically load your sound 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 6:57pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/3 "2002-11-05T18:57:00Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 6:58pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/4 "2002-11-05T18:58:21Z")

</div>

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)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 6:59pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/5 "2002-11-05T18:59:00Z")

</div>

Check this out on how to dynamically load sound, it is at the bottom…

[http://www.kirupa.com/developer/mx/loading.asp](http://www.kirupa.com/developer/mx/loading.asp)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 7:22pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/6 "2002-11-05T19:22:13Z")

</div>

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  
:\*(

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 7:53pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/7 "2002-11-05T19:53:25Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 8:11pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/8 "2002-11-05T20:11:01Z")

</div>

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 :-\

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 8:16pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/9 "2002-11-05T20:16:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 5, 2002, 8:19pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/10 "2002-11-05T20:19:34Z")

</div>

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 ☹

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 6, 2002, 5:11am UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/11 "2002-11-06T05:11:18Z")

</div>

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](http://64.225.103.218/voices_frame.php3?voice_id=1&type=All&sex=Male)

How do they do this…😏

Bill

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 6, 2002, 5:54pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/12 "2002-11-06T17:54:42Z")

</div>

I think that might actually be a different .swf file for each. If you view the source it looks like this…

```php
 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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 8, 2003, 5:27pm UTC](https://forum.kirupa.com/t/loadsound-html-link/7678/13 "2003-01-08T17:27:21Z")

</div>

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…
