Jump to content

Php variables to Flash action script? Help Please :?


Freid001

Recommended Posts

Hi every.

 

I am trying to pass a php variable ($R1 = 1) in to flash 8 action script however im not sure how to do this?

 

$R1 = 1

 

Any help would be great!

 

Also when in flash how do I get the action script to pick up the php variable $R1 = 1?

 

Thanks  :confused: :confused: :confused:

 

  • 2 weeks later...

from php echo an urlencoded line to send to flash like following

 

echo "varNameForFlashToPickUp=".rawurlencode($phpVariable)."";
//if that doesn't work, add a & before 'varNameForFlashToPickUp'

 

from within flash use the LoadVars method to load variables into flash

 

var phpVariables:LoadVars = new LoadVars();
phpVariables.onLoad = function(){
   trace(phpVariables.varNameForFlashToPickUp);
}
phpVariables.load("phpFile.php");

 

the rawurlencode funtion in php is used to make sure that all special characters like $ don't mess with the rest of the code

flash automatically decodes

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.