liquidgraph
06-18-2007, 01:24 AM
I'm using FlashVars to pass along two simple variables (previouspage & currentpage) to my .swf. Problem is, inside the .swf, these variables aren't recognized (it's telling me that the variables are undefined).
How exactly would I call the variables in Flash? And where would this call be made? I've tried what seems like every possiblity, but the variables are still "undefined."
My HTML Code:
<?php
session_start();
if(isset($_SESSION['previoustemp']))
{
}
else
{
$_SESSION['previoustemp'] = 123;
}
$_SESSION['current'] = 0;
$_SESSION['previous'] = $_SESSION['previoustemp'];
$_SESSION['previoustemp'] = $_SESSION['current'];
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="../../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body>
<?php
echo "current: ". $_SESSION['current'] . "<br>";
echo "previous: ". $_SESSION['previous'] . "<br>";
echo "previoustemp: ". $_SESSION['previoustemp'];
?>
<a href="resume01.php">resume</a>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','508','height','25','title','test','src','../../flash/leogura_banner_02','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../../flash/leogura_banner_02' ); //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=9,0,28,0" width="508" height="25" title="test">
<param name="movie" value="../../flash/leogura_banner_02.swf" />
<param name="flashvars" value="previouspage=1¤tpage=0" />
<param name="quality" value="high" />
<embed src="../../flash/leogura_banner_02.swf" flashvars="previouspage=1¤tpage=0" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="508" height="25" ></embed>
</object>
</noscript></body>
</html>
My Flash Code:
switch(_root.previouspage){
case "0":
arrow01._x = 29;
break;
case "1":
arrow01._x = 101;
break;
case "portfolio":
arrow01._x = 181;
break;
case "education":
arrow01._x = 268;
break;
case "epistemology":
arrow01._x = 368;
break;
case "contact":
arrow01._x = 464;
break;
default:
arrow01._x = 300;
}
_root.texttext = _root.previouspage;
_root.currenttext = _root.currentpage;
How exactly would I call the variables in Flash? And where would this call be made? I've tried what seems like every possiblity, but the variables are still "undefined."
My HTML Code:
<?php
session_start();
if(isset($_SESSION['previoustemp']))
{
}
else
{
$_SESSION['previoustemp'] = 123;
}
$_SESSION['current'] = 0;
$_SESSION['previous'] = $_SESSION['previoustemp'];
$_SESSION['previoustemp'] = $_SESSION['current'];
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="../../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body>
<?php
echo "current: ". $_SESSION['current'] . "<br>";
echo "previous: ". $_SESSION['previous'] . "<br>";
echo "previoustemp: ". $_SESSION['previoustemp'];
?>
<a href="resume01.php">resume</a>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','508','height','25','title','test','src','../../flash/leogura_banner_02','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','../../flash/leogura_banner_02' ); //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=9,0,28,0" width="508" height="25" title="test">
<param name="movie" value="../../flash/leogura_banner_02.swf" />
<param name="flashvars" value="previouspage=1¤tpage=0" />
<param name="quality" value="high" />
<embed src="../../flash/leogura_banner_02.swf" flashvars="previouspage=1¤tpage=0" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="508" height="25" ></embed>
</object>
</noscript></body>
</html>
My Flash Code:
switch(_root.previouspage){
case "0":
arrow01._x = 29;
break;
case "1":
arrow01._x = 101;
break;
case "portfolio":
arrow01._x = 181;
break;
case "education":
arrow01._x = 268;
break;
case "epistemology":
arrow01._x = 368;
break;
case "contact":
arrow01._x = 464;
break;
default:
arrow01._x = 300;
}
_root.texttext = _root.previouspage;
_root.currenttext = _root.currentpage;