I want a link to trigger a sound click in flash AS3. I've taken the .play() outside of the function to confirm that it works by itself. What am I missing that will let me call an AS3 function from javascript?
Here is my html
<object width="5px" height="5px">
<param name="movie" value="play_coin_sound/playCoin.swf?v=5">
<param name="wmode" value="transparent">
<embed src="play_coin_sound/playCoin.swf?v=5" width="5px" height="5px">
</object>
<span id="play-sound">Play Sound</span>
Here is my javascript
$('#play-sound').click(function(){ playCoin(); });
Here is my AS3 function
var coinSound:Sound = new Sound();
coinSound.load(new URLRequest("coin.mp3"));
function playCoin() {
coinSound.play();
}
Any ideas?