Jump to content

Php variables to Flash action script? Help Please :?


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.