Javascript to reload a embedded flash movie.

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by enox10mx, Apr 8, 2012.

  1. enox10mx

    enox10mx New Member

    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    0
    Hi.
    On My Website i have an embedded flash video game.
    I want to use javascript to reload the flash game when the user clicks a button/link.
    here is the embed code:
    HTML:
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="320" HEIGHT="240" id="static/TankTrouble_v3.6a.swf" ALIGN="center">
     <PARAM NAME=movie VALUE="static/TankTrouble_v3.6a.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#333399> <EMBED src="static/TankTrouble_v3.6a.swf" quality=high bgcolor=#333399 WIDTH="320" HEIGHT="240" NAME="static/TankTrouble_v3.6a.swf" ALIGN="center" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT>
    
    How could I do this?
     
    Last edited: Apr 8, 2012
  2. ellescuba27

    ellescuba27 Member

    Messages:
    274
    Likes Received:
    3
    Trophy Points:
    18
    HTML:
    <span id="objectspan"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="320" HEIGHT="240" id="static/TankTrouble_v3.6a.swf" ALIGN="center">  <PARAM NAME=movie VALUE="static/TankTrouble_v3.6a.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#333399> <EMBED src="static/TankTrouble_v3.6a.swf" quality=high bgcolor=#333399 WIDTH="320" HEIGHT="240" NAME="static/TankTrouble_v3.6a.swf" ALIGN="center" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED> </OBJECT></span>
    <script LANGUAGE="Javascript">
    var objectspanmakeinnerhtml = "";
    function editobjectspan() {
    objectspanmakeinnerhtml = document.getElementById("objectspan").innerHTML;
    document.getElementById("objectspan").innerHTML = "";
    document.getElementById("objectspan").innerHTML = objectspanmakeinnerhtml;
    }
    </script>
    To clear with link:

    HTML:
    <a href="#" onClick="editobjectspan();return false;"></a>
     
  3. enox10mx

    enox10mx New Member

    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    0
  4. ellescuba27

    ellescuba27 Member

    Messages:
    274
    Likes Received:
    3
    Trophy Points:
    18
    It technically doesn't reload it, just overwrites what's on the page (that may mean it will have to do the loading screen again).
     

Share This Page