all groups > macromedia flash flash remoting > august 2005 >
You're in the

macromedia flash flash remoting

group:

help me in PHP2FLASH


help me in PHP2FLASH hamid747
8/25/2005 9:23:59 AM
macromedia flash flash remoting:
hi everybody,
i want to use a link in Flash movie that path of this link loaded by a
variable in php.i wrote the code for that as follows and it works good but only
in Internet Explorer,in Firefox or another browser like opera,insist of link
page i have error [undefined]!!!

my flash link code:
on (press) {
var MyURL = _root.MyURL;
getURL(MyURL);
}

my php code:
<?php
$MyURL= "http://nh-masterlenz.de";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>+++ NH3DSTUDIO+++</title>
</head>
<body bgcolor="#ffffff" leftmargin="10" topmargin="10">
<!--Im Film verwendete URLs-->
<!--Im Film verwendeter Text-->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
version=7,0,0,0" width="959" height="555" id="intro" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="NH.swf?MyURL=<?php echo $MyURL; ?>"/>
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="NH.swf" quality="high" bgcolor="#ffffff" width="959" height="555"
name="intro" align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>

i think this error is because of i defined my variable manually in php page
after my flash file(NH.swf?MyURL=<?php echo $MyURL; ?>/)and another browser
can't support this method except Internet Explorer!
now can enybody help me by offering another method og sending my variable from
php to flash?
besides i'm totaly new with php.
thanks for your consideration.
Re: help me in PHP2FLASH seand03
8/25/2005 8:39:56 PM
hamid747-
You are correct in how this should work, but in your webpage that contains the
object tag you need to also include your variable MyURL in the embed tag. This
is because some browsers get the necessary info from the paramater tag while
others get it from the embed tag. The modified html code is below.
Sean

<?php
$MyURL= "http://nh.masterlenz.de";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>+++ NH3DSTUDIO+++</title>
</head>
<body bgcolor="#ffffff" leftmargin="10" topmargin="10">
<!--Im Film verwendete URLs-->
<!--Im Film verwendeter Text-->
<object classid="clsid27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
version=7,0,0,0" width="959" height="555" id="intro" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="NH.swf?MyURL=<?php echo $MyURL; ?>"/>
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="NH.swf?MyURL=<?php echo $MyURL; ?>" quality="high"
bgcolor="#ffffff" width="959" height="555" name="intro" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>
Re: help me in PHP2FLASH hamid747
8/26/2005 7:39:17 AM
hi Sean,
i'm so thankfull for your short & smart tips,i test it with Firefox,Opera and netscape and it works perfect ! Wow
Re: help me in PHP2FLASH rumpelstilzchenlang
9/14/2005 8:16:16 PM
AddThis Social Bookmark Button