Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making a <param> value a variable

Status
Not open for further replies.

cesarcesar

Programmer
Mar 5, 2003
30
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=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot; >
<!--
var mediatype = &quot;windowsmedia&quot;;
var whatClip = &quot;audio/t1.asx&quot;;


//-->
</script>

<div id=&quot;divWmp&quot; class=&quot;clsWmp&quot;>
<object id=&quot;WMP&quot; width=232 height=45 classid=&quot;CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95&quot; codebase= &quot; standby=&quot;Please wait while windows downloads necessary codecs...&quot; type=&quot;application/x-oleobject&quot; vspace=&quot;1&quot; name=&quot;WMP&quot;>

<param name=&quot;FileName&quot; value=&quot;audio/t1.asx&quot;> // <--THIS PART

<param name=&quot;AutoStart&quot; value=&quot;True&quot;>
<param name=&quot;ShowStatusBar&quot; value=&quot;False&quot;>
<param name=&quot;BufferingTime&quot; value=&quot;5&quot;>
<param name=&quot;ShowControls&quot; value=&quot;1&quot;>
<param name=&quot;AnimationAtStart&quot; value=&quot;1&quot;>
<param name=&quot;BackgroundColor&quot; value=&quot;#663333&quot;>
<embed type=&quot;application/x-mplayer2&quot;
src=&quot;audio/t1.asx&quot; /// <-- ALSO HERE width=232
height=45 name=&quot;WMP&quot;> </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
 
hi flashgroover,

in my experience, this can only be done at load time:
Code:
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot; >
<!--

function writeFlash(whatClip) {
	document.writeln('<object id=&quot;WMP&quot; width=232 height=45' +
		'classid=&quot;CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95&quot;' +
		'codebase= [URL unfurl="true"]http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715&quot;'[/URL] +
		'standby=&quot;Please wait while windows downloads necessary codecs...&quot;' +
		'type=&quot;application/x-oleobject&quot; vspace=&quot;1&quot; name=&quot;WMP&quot;>' +
		'<param name=&quot;FileName&quot; value=&quot;' + whatClip + '&quot;>' +
		'<param name=&quot;AutoStart&quot; value=&quot;True&quot;>' + 
		'<param name=&quot;ShowStatusBar&quot; value=&quot;False&quot;>' + 
		'<param name=&quot;BufferingTime&quot; value=&quot;5&quot;>' + 
		'<param name=&quot;ShowControls&quot; value=&quot;1&quot;>' + 
		'<param name=&quot;AnimationAtStart&quot; value=&quot;1&quot;>' + 
		'<param name=&quot;BackgroundColor&quot; value=&quot;#663333&quot;>' + 
		'<embed type=&quot;application/x-mplayer2&quot;' + 
		'src=&quot;' + whatClip + '&quot;' + 
		'width=232 height=45 name=&quot;WMP&quot;> </embed>' + 
		'</object>');
}

//-->
</script>

<div id=&quot;divWmp&quot; class=&quot;clsWmp&quot;>
	<script language=&quot;javascript&quot;>writeFlash(&quot;audio/t1.asx&quot;);</script>
</div>




================================================================================================================
=========================================================
while (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top