Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    864
    Thanks
    51
    Thanked 6 Times in 5 Posts

    input cd drive letter for later use on the page

    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

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Would this work?

    Code:
    <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
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    864
    Thanks
    51
    Thanked 6 Times in 5 Posts
    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

  • #4
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    864
    Thanks
    51
    Thanked 6 Times in 5 Posts
    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

  • #5
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Active - X is proprietary. IE only.

    Basscyst
    Helping to build a bigger box. - Adam Matthews


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •