Jump to content

Php to action script? Help!


Freid001

Recommended Posts

Hi everyone

 

I am trying to pass a php variable ($R1 = 1) in to action script flash 8.

 

After this variable is in flash 8 I want the action script to do a if statement that says if the php variable is = 1 then display layer or object.

 

However i am not sure how to do this any help would be great thanks

 

Freid001

 

PS if this is not possible to do with php and action script please say thanks

Link to comment
https://forums.phpfreaks.com/topic/212898-php-to-action-script-help/
Share on other sites

Maybe i didn’t explain my self so well, 1.firstly you will have to create a dynamic text field (make sure you name the variable on it , example myVar).

2. select the dynamic text box and convert it to a movieClip (F8).

3. add the following actions to the moiveClip....

 

onClipEvent (load) {

  loadVariables("your-vars.php", this, "GET");

}

4. Create a your php file and put inside the following php code...

Action script would interpt php varibles but $var will still be printed.

<?php

$var = "as-php";

print $var;

print "myVar=$var";

?>

Actionscript will recognize myVar and put the $var value inside you dynamic text box providing that the text box was the correct variable name.

5. now you have the value of your php var inside your text box your ready to put in an if statement

If (myVar eq”as-php”) {

getURL(‘’);

}

else {

getURL(‘’);

}

don’t no what you are going to do with the if statement so that’s just an example. 

 

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.