Help (document.name.play();)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jenny

    Help (document.name.play();)

    This is an old post. How to make it work?

    ------------------

    Hi

    If anyone out there could figure out why the following script dosen't
    work, and maybe help me fixing the problem, I would be very gratefull.

    //Html document starts:

    <HTML>
    <HEAD>
    <TITLE>test</TITLE>
    <SCRIPT>

    <!-- Activate Cloaking Device



    // Used to startmusic

    function StartMusic()

    { document.tak.pl ay(); }

    // Used to stopmusic

    function StopMusic()

    { document.tak.st op(); }



    // Deactivate Cloaking -->

    </SCRIPT>

    </HEAD>
    <BODY>

    <embed name="tak" autostart=false hidden=true src="midi6.mid" >

    <CENTER>

    <FORM>

    <TABLE BORDER=0 WIDTH=550>

    <TD align="center"> <INPUT TYPE="button" VALUE="*** Start Music ***"
    onClick=StartMu sic();>

    </TABLE>
    <TABLE BORDER=0 WIDTH=550>

    <TD align="center"> <INPUT TYPE="button" VALUE="*** Stop Music ***"
    onClick=StopMus ic();>

    </TABLE>

    </FORM>

    </CENTER>

    </BODY>
    </HTML>

    //Html document stops

    What I want to do is, load a midifile, have to boxes you can click on,
    one which turns on the music, and one which turns off the music.

    Any help grately appreciated.

    Greets
    /Martin
  • Randy Webb

    #2
    Re: Help (document.name. play();)

    Jenny wrote:
    [color=blue]
    > This is an old post. How to make it work?
    >[/color]

    <--snip-->
    [color=blue]
    > What I want to do is, load a midifile, have to boxes you can click on,
    > one which turns on the music, and one which turns off the music.[/color]

    Very easily. Don't hide the embed, then the browser will put buttons on
    the page to do exactly that. No script needed. And that simplicity is
    probably why it wasn't answered the first time.

    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • chirs

      #3
      Re: Help (document.name. play();)

      But how to use script to play sound based on some condition? This was
      the question of the post.


      Randy Webb <HikksNotAtHome @aol.com> wrote in message news:<qMadnUP9f biEte3cRVn-1w@comcast.com> ...[color=blue]
      > Jenny wrote:
      >[color=green]
      > > This is an old post. How to make it work?
      > >[/color]
      >
      > <--snip-->
      >[color=green]
      > > What I want to do is, load a midifile, have to boxes you can click on,
      > > one which turns on the music, and one which turns off the music.[/color]
      >
      > Very easily. Don't hide the embed, then the browser will put buttons on
      > the page to do exactly that. No script needed. And that simplicity is
      > probably why it wasn't answered the first time.[/color]

      Comment

      • Randy Webb

        #4
        Re: Help (document.name. play();)

        chirs wrote:[color=blue]
        > But how to use script to play sound based on some condition? This was
        > the question of the post.
        >[/color]

        You start by consulting the FAQ, all of it. The URL is in my signature.
        As for playing sound based on a condition, good luck. The reason is
        there are more ways to disable sound in the browser (and more reasons to
        do so), then there are reasons to have it enabled. If its for an
        intranet environment where you know the sound is available, and you know
        the browsers in use, you might be able to get it to work.


        --
        Randy
        comp.lang.javas cript FAQ - http://jibbering.com/faq
        Answer:It destroys the order of the conversation
        Question: Why?
        Answer: Top-Posting.
        Question: Whats the most annoying thing on Usenet?

        Comment

        Working...