Adding flash & javascript to a PHP variable - correct sy

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
jpmad4it2
Forum Newbie
Posts: 6
Joined: Fri Jul 13, 2007 6:38 am

Adding flash & javascript to a PHP variable - correct sy

Post by jpmad4it2 »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


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:

Code: Select all

$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>";
Now here is the code I require to put in the $flash variable:

Code: Select all

<!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>
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:

Code: Select all

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

Kind regards
Jonathan


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
jpmad4it2
Forum Newbie
Posts: 6
Joined: Fri Jul 13, 2007 6:38 am

Post by jpmad4it2 »

hey sorry about that :oops:

I will be sure to adhere to the rules in my future posts!
jpmad4it2
Forum Newbie
Posts: 6
Joined: Fri Jul 13, 2007 6:38 am

Post by jpmad4it2 »

Why is this classed as client side when i require the code to be written in PHP?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

At this time, it appears to be a client-side issue having little to do with PHP.
jpmad4it2
Forum Newbie
Posts: 6
Joined: Fri Jul 13, 2007 6:38 am

Post by jpmad4it2 »

feyd wrote:At this time, it appears to be a client-side issue having little to do with PHP.
Yes but I require the HTML code to be written in PHP to add it to a PHP variable - therefore people with PHP experience would know best how to write the code? :?

I know the code is client side, but i would like help to convert into PHP - which is server side.
Post Reply