Click to See Complete Forum and Search --> : passing variable into <param> value


flashgroover
03-12-2003, 05:11 PM
i have a Windows Media Player <object> tag below that has <param> in it. i want to have the PARAM VALUE to accept a pre-set variable. it looks something like this-

<script language="JavaScript" type="text/JavaScript" >
<!--
var mediatype = "windowsmedia";
var whatClip = "audio/t1.asx";


//-->
</script>

<div id="divWmp" class="clsWmp">
<object id="WMP" width=232 height=45 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase= "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Please wait while windows downloads necessary codecs..." type="application/x-oleobject" vspace="1" name="WMP">

<param name="FileName" value="audio/t1.asx"> // <--THIS PART

<param name="AutoStart" value="True">
<param name="ShowStatusBar" value="False">
<param name="BufferingTime" value="5">
<param name="ShowControls" value="1">
<param name="AnimationAtStart" value="1">
<param name="BackgroundColor" value="#663333">
<embed type="application/x-mplayer2"

src="audio/t1.asx" /// <-- ALSO HERE
width=232
height=45 name="WMP"> </embed>
</object>
</div>

in the two places were it calls for either a VALUE or SRC i want to put the variable WHATCLIP in its place. havnt been able to get it to work. thanks for the help.

flashgroover

Dan Drillich
03-12-2003, 05:52 PM
Please replace -


<param name="FileName" value="audio/t1.asx">


with -


<script>

document.write('<param name="FileName" value="' + whatClip + '">');

</script>

flashgroover
03-13-2003, 11:31 AM
couldnt get your script to work.. but this does-

http://www.tek-tips.com/gviewthread.cfm/lev2/4/lev3/32/pid/216/qid/499075