Adding Flash & JavaScript to a PHP variable

Discussion in 'PHP' started by jpmad4it, Jul 13, 2007.

  1. #1
    Hey people!

    I have a PHP variable named flash, and within it I have the <object> element which creates the flash output. So whenever i call the variable i get the flash. Now the problem is that I am getting the "click to activate and use this control" box which I want to get rid of. So to do this I want to add the AC_RunActiveContent.js script to this variable. Is this possible? If so how do I write the code? This is the code I have already:

    $flash = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"157\" height=\"198\">
      <param name=\"movie\" value=\"http://www.mysite.com/scroller.swf\">
      <param name=\"quality\" value=\"high\">
      <embed src=\"http://www.mysite.com/scroller.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"157\" height=\"198\"></embed></object>";
    Code (markup):
    Now here is the code I require to put in the $flash variable:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script language="javascript" type="text/javascript">AC_FL_RunContent = 0;</script>
    <script src="AC_RunActiveContent.js" language="javascript" type="text/javascript"></script>
    </head>
    
    <body>
    	<script language="javascript" type="text/javascript">
    	if (AC_FL_RunContent == 0) {
    		alert("This page requires AC_RunActiveContent.js. In Flash, run \"Apply Active Content Update\" in the Commands menu to copy AC_RunActiveContent.js to the HTML output folder.");
    	} else {
    		AC_FL_RunContent(
    			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0',
    			'src', 'http://www.mysite.com/scroller',
    			'quality', 'high',
    			'pluginspage', 'https://www.macromedia.com/go/getflashplayer',
    			'play', 'true',
    			'loop', 'true',
    			'scale', 'showall',
    			'devicefont', 'false',
    			'bgcolor', '#ffffff',
    			'menu', 'true',
    			'allowScriptAccess','sameDomain',
    			'movie', 'http://www.mysite.com/scroller',
    			'class', '',
    			'salign', ''
    			); //end AC code
    	}
    </script>
          <noscript>
          <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" class="Flash" title="team">
            <param name="movie" value="http://www.mysite.com/scroller.swf" />
            <param name="quality" value="high" />
            <param name="wmode" value="opaque" />
            <param name="allowScriptAccess" value="sameDomain" />
            <embed src="http://www.mysite.com/scroller.swf" class="Flash" quality="high" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowScriptAccess="sameDomain"></embed>
          </object>
          </noscript>
        </body>
    </html>
    Code (markup):
    I'm not sure if I have to put all the <Html> tags etc in, but I do know that these 2 lines are required in the <head> tag:

    <script language="javascript" type="text/javascript">AC_FL_RunContent = 0;</script>
    <script src="AC_RunActiveContent.js" language="javascript" type="text/javascript"></script>
    Code (markup):
    Any help would be grrrrreeeeeeaaaaat!!

    Kind regards
    Jonathan :thumbsup:
     
    jpmad4it, Jul 13, 2007 IP
  2. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    From what I understand thats a security feature from IE7.

    The solution is quite simple with only one step:
    1. Get another browser like Firefox or Opera.

    Other than that, bypassing that message isn't possible.
     
    MMJ, Jul 13, 2007 IP
  3. jpmad4it

    jpmad4it Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well actually, it is possible, i've used this script before and it works fine. This is just a different way of using it, so it requires different coding. If you don't have anything useful to say other than trying to start a stupid browser war.........dont bother.
     
    jpmad4it, Jul 16, 2007 IP