...

View Full Version : input cd drive letter for later use on the page



tpeck
04-13-2005, 03:30 PM
Hi. I have a piece of Active-X code that plays a track from a CD in the CD drive:

********************

<OBJECT id=player height=64 width=160 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6></OBJECT>
<script>
player.uiMode="mini"
player.settings.autoStart=false
player.settings.volume=50
player.URL=src="'file:///"+letter+":/Track01.cda'"
</script>

*********************

Well, it does if I specify the CD drive letter.

You'll notice the variable "letter" because I would like the user to enter their own drive letter so the audio file will play whatever drive is the CD drive.

Am I asking the impossible? It seems to gasp and choke and throw errors before any attempt I make to get the input.

Thanks,

Terry

A1ien51
04-13-2005, 04:22 PM
Would this work?



<script type="text/javascript">
document.getElementById("player").uiMode="mini"
document.getElementById("player").settings.autoStart=false
document.getElementById("player").settings.volume=50
var letter = prompt("CD DRIVE:","D");
document.getElementById("player").src="'file:///"+letter+":/Track01.cda'"
</script>


Eric

tpeck
04-13-2005, 11:31 PM
Yes, it works well in IE - thanks Eric. Very neat solution.

Do you have any understanding as to why it doesn't work in Firefox? I thought Active-X was no problem for these modern browsers...

Terry

tpeck
04-14-2005, 12:29 AM
Interesting that more than one instance of the code that Eric supplied still requires another separate input of the CD driveletter.

Why doesn't it propagate throughout the page? I thought a variable once inputted would last within that page wherever it lived.

Oh well,

Terry

Basscyst
04-14-2005, 01:09 AM
Active - X is proprietary. IE only.

Basscyst



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum