Results 1 to 5 of 5

Thread: displaying a movie..

  1. #1

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    displaying a movie..


    Hi there,
    Please help me with the following "script" in which I wanted to display
    an AVI movie..on my html page.I want my "movie to be very next to the BUTTON..
    but any time I click to watch it. it displays in another white page and my
    button disappears..How can I have them both on the same page.?.(my button and my movie)
    I dont want to use "frames" I just want to click and there goes my movie..hope you got my poor English..thanks

    ......................

    <html>
    <head>
    </head>

    <body bgcolor=silver>

    <script language="javascript">
    function start_to_watch()
    {
    document.write('<embed src="my.avi" width="250" height="250" autostart=true hidden="false" />')
    }
    </script>

    <form>
    <input type=button style=background:blue;color:yellow;font-size:24; value="watch it now" onClick="start_to_watch()">
    </form>
    </body>
    </html>

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    hmmm

    Try This:

    Code:
    <html>
    <head>
    </head>
    
    <body bgcolor=silver>
    
    <script language="javascript">
    function start_to_watch()
    {
    var div;
    div=document.getElementById('Moviediv');
    
    div.innerHTML='<embed src="my.avi" width="250" height="250" autostart=true hidden="false" />';
    
    }
    </script>
    
    <form>
    <div width=250 height=250 name="Moviediv"></div>
    
    <input type=button style=background:blue;color:yellow;font-size:24; value="watch it now" onClick="start_to_watch()">
    </form>
    </body>
    </html>
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    very small change in code required (at least for me)
    change the DIVs "name" property to "id".
    so NOT:
    name="Moviediv"
    but
    id="Moviediv"

  4. #4
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    Whoops

    I wrote it to fast - sorry, it's ofcourse ID (getElementById), My bad!
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    And you'll probably want quotes around the style property value of the button - though most browsers will accept the wrong code too.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width