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
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. 

 

Link to comment
Share on other sites

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.