Hello everyone,
I was wondering if there is a way to pass variables to my swf from a simple url link, like:
http://www.whatever.com/myswf.swf?bla=123&bla2=456
So on my swf i would get the values of bla and bla2.
Kind regards,
Leo.
Printable View
Hello everyone,
I was wondering if there is a way to pass variables to my swf from a simple url link, like:
http://www.whatever.com/myswf.swf?bla=123&bla2=456
So on my swf i would get the values of bla and bla2.
Kind regards,
Leo.
You need a php page, where your movie is embedded. Here is an example of such page, where the login data are transferred to the movie.
Inside your movie you are asking for the loaderinfo:PHP Code:<?php
/************************************************************
Payment.php
*************************************************************/
// variables from the movie
$log = $_GET['login'];
echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>Mailing</title>
<script language='javascript'>AC_FL_RunContent = 0;</script>
<script src='AC_RunActiveContent.js' language='javascript'></script>
</head>
<body bgcolor='#ffffff'>
<center>
<script language='javascript'>
if (AC_FL_RunContent == 0) {
alert('This page requires AC_RunActiveContent.js.');
} else {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '900',
'height', '750',
'src', 'Payment',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'id', 'Payment',
'bgcolor', '#ffffff',
'name', 'Payment',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'Payment?login=".$log."',
'salign', ''
); //end AC code
}
</script></a>
</center>
</body>
</html>";
?>
root.loaderInfo.parameters.login
Thanks a lot!
Gonna work on it right away!
You don't need PHP. Swfobject has a built in method called getQueryParamVal
http://clipboard.com/clip/LQXr7IQ1Zg...bsa1ydPdva3due
http://code.google.com/p/swfobject/wiki/api