Web Hosting Talk







View Full Version : javascript for flash cs4 into PHP5


luespi
03-16-2010, 06:30 PM
Please please,

I am trying to insert a flash animation (a banner with the company logo), into PHP (for JOOMLA 1.5), I need to insert correctly the javascript script needed for it to be reproduced properly, but I dont know what am doing wrong, :




echo ' <div class="pg_splitter">





<center>

<img src="http://nameofmyclientsite.com/portalfinal/images/publicidad/bannertop.jpg">
<br>








<script language=\"javascript\">
if (AC_FL_RunContent == 0) {
alert(\"Esta página requiere el archivo AC_RunActiveContent.js.\");
} else {
AC_FL_RunContent(\n
\'codebase\', \'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\',\n
\'width\', \'900\',\n
\'height\', \'300\',\n
\'src\', \'logoweb\',\n
\'quality\', \'high\',\n
\'pluginspage\', \'http://www.macromedia.com/go/getflashplayer\',\n
\'align\', \'middle\',\n
\'play\', \'true\',\n
\'loop\', \'true\',\n
\'scale\', \'showall\',\n
\'wmode\', \'window\',\n
\'devicefont\', \'false\',\n
\'id\', \'logoweb\',\n
\'bgcolor\', \'#ffffff\',\n
\'name\', \'logoweb\',\n
\'menu\', \'true\',\n
\'allowFullScreen\', \'false\',\n
\'allowScriptAccess\',\'sameDomain\',\n
\'movie\', \'logoweb\',\n
\'salign\', \'\'\n
); //end AC code\n
}\n
</script>
<noscript>\n
<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"900\" height=\"300\" id=\"logoweb\" align=\"middle\">
<param name=\"allowScriptAccess\" value=\"sameDomain\" />
<param name=\"allowFullScreen\" value=\"false\" />
<param name=\"movie\" value=\"http://www.nameofmyclientsite.com/logoweb.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /> <embed src=\"http://www.nameofmyclientsite.com/logoweb.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"900\" height=\"300\" name=\"logoweb\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
</object>

</noscript>









</div>' . "\n" ;











the funny thing is that when I load the site and check for source code it shows me this:







<div class="pg_splitter">





<center>

<img src="http://nameofmyclientsite.com/portalfinal/images/publicidad/bannertop.jpg">
<br>








<script language=\"javascript\">
if (AC_FL_RunContent == 0) {
alert(\"Esta página requiere el archivo AC_RunActiveContent.js.\");
} else {
AC_FL_RunContent(\n
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',\n
'width', '900',\n
'height', '300',\n
'src', 'logoweb',\n
'quality', 'high',\n
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',\n
'align', 'middle',\n
'play', 'true',\n
'loop', 'true',\n
'scale', 'showall',\n
'wmode', 'window',\n
'devicefont', 'false',\n
'id', 'logoweb',\n
'bgcolor', '#ffffff',\n
'name', 'logoweb',\n
'menu', 'true',\n
'allowFullScreen', 'false',\n
'allowScriptAccess','sameDomain',\n
'movie', 'logoweb',\n
'salign', ''\n
); //end AC code\n
}\n
</script>
<noscript>\n
<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"900\" height=\"300\" id=\"logoweb\" align=\"middle\">
<param name=\"allowScriptAccess\" value=\"sameDomain\" />
<param name=\"allowFullScreen\" value=\"false\" />
<param name=\"movie\" value=\"http://www.nameofmyclientsite.com/logoweb.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /> <embed src=\"http://www.nameofmyclientsite.com/logoweb.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"900\" height=\"300\" name=\"logoweb\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
</object>

</noscript>










</div>














note:
the image

"http://nameofmyclientsite.com/portalfinal/images/publicidad/bannertop.jpg"

shows perfectly right where it showd be, that is above the place whre the banner should be showing, and instead of the banner I get a rectangle space, of the size of the banner.






HELPMMMMMMMMMMEEEEEEEEEEEEEEEE!!!!!!!!
PLEASE!!!!!!!!!
thanks!
.
.
.
.
.
.
.
.
.

mattle
03-17-2010, 08:24 AM
Um...notice how you're getting all of your quote escapements and "\n"s in your output? You have a fundamental misunderstanding of PHP quoting. See here: http://php.net/manual/en/language.types.string.php. I recommend the nowdoc syntax for this, btw.

luespi
03-18-2010, 05:14 PM
it is difficult to undertand,can u explain this.


I need this javascript to be put into index.php, it needs to be passsed into the web browsewr of the final user, that is into the front end (php version is php5):

<script language="javascript">
if (AC_FL_RunContent == 0) {
alert("Esta página requiere el archivo AC_RunActiveContent.js.");
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '900',
'height', '300',
'src', 'logoweb',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'logoweb',
'bgcolor', '#ffffff',
'name', 'logoweb',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'logoweb',
'salign', ''
); //end AC code
}
</script>



I already made the script call from the headers, but I am confused with the script it self it needs to be overlooked by php so it just be passed to the browser