misslilbit02
Programmer
Hi All,
Thank you so much for a community forum like this one. Ok this is the deal. I'm not program saavy so please be tender.
What I'm tyring to accomplish is having multiple drop down menus on a .htm pg which passes a song (the variable) to my embedded flash player which in turn plays the selected song. Ok so far I think I have a grip on the passing the variable thing (the code is below).
I've gotten confused because I know you have to unload the variable in FLASH but I'm lost in how you pass this variable to the player. I've been using this code to pass the variable:
loadMovie(_root.&sound);
but I keep getting this error in flash:
Scene=Scene 1, Layer=actions, Frame=1: Line 1: Expected a field name after '.' operator.
loadMovie(_root.&sound);
Please help.
So far this is my .htm
<html>
<head>
<script type="text/javascript">
function getVar(variable)
{
document.getElementById('flash').innerHTML = '<object type="application/x-shockwave-flash" data="audioplayer.swf" width="200" height="200">\n'
+'<param name="movie" value="audioplayer.swf">\n'
+'<param name="FlashVars" value="&sound='+variable+'">\n'
+'</object>';
}
</script>
</head>
<body>
<form action="#" method="post">
<select name="menu" onChange="getVar(this.options[this.selectedIndex].value)">
<option value="#">Play Demo</option>
<option value="B01.wma">Bumper 1Demo</option>
<option value="/music/bumpers/B02.wma">Bumper 2Demo</option>
</select>
</form>
<div id="flash">
<object type="application/x-shockwave-flash" data="audioplayer.swf" width="200" height="200">
<param name="movie" value="audioplayer.swf">
<param name="FlashVars" value="&sound=#">
</object>
</div>
</body>
</html>
FLASH:
loadMovie(_root.&sound);
Thank you so much for a community forum like this one. Ok this is the deal. I'm not program saavy so please be tender.
What I'm tyring to accomplish is having multiple drop down menus on a .htm pg which passes a song (the variable) to my embedded flash player which in turn plays the selected song. Ok so far I think I have a grip on the passing the variable thing (the code is below).
I've gotten confused because I know you have to unload the variable in FLASH but I'm lost in how you pass this variable to the player. I've been using this code to pass the variable:
loadMovie(_root.&sound);
but I keep getting this error in flash:
Scene=Scene 1, Layer=actions, Frame=1: Line 1: Expected a field name after '.' operator.
loadMovie(_root.&sound);
Please help.
So far this is my .htm
<html>
<head>
<script type="text/javascript">
function getVar(variable)
{
document.getElementById('flash').innerHTML = '<object type="application/x-shockwave-flash" data="audioplayer.swf" width="200" height="200">\n'
+'<param name="movie" value="audioplayer.swf">\n'
+'<param name="FlashVars" value="&sound='+variable+'">\n'
+'</object>';
}
</script>
</head>
<body>
<form action="#" method="post">
<select name="menu" onChange="getVar(this.options[this.selectedIndex].value)">
<option value="#">Play Demo</option>
<option value="B01.wma">Bumper 1Demo</option>
<option value="/music/bumpers/B02.wma">Bumper 2Demo</option>
</select>
</form>
<div id="flash">
<object type="application/x-shockwave-flash" data="audioplayer.swf" width="200" height="200">
<param name="movie" value="audioplayer.swf">
<param name="FlashVars" value="&sound=#">
</object>
</div>
</body>
</html>
FLASH:
loadMovie(_root.&sound);