# Calling a variable from php to second swf

**URL:** <https://forum.kirupa.com/t/calling-a-variable-from-php-to-second-swf/322669>\
**Category:** Uncategorized\
**Created:** [May 29, 2011, 8:05pm UTC](https://forum.kirupa.com/t/calling-a-variable-from-php-to-second-swf/322669 "2011-05-29T20:05:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tajzel](https://avatars.discourse-cdn.com/v4/letter/t/f1d935/32.png) [@tajzel](https://forum.kirupa.com/u/tajzel)\
**Post date:** [May 29, 2011, 8:05pm UTC](https://forum.kirupa.com/t/calling-a-variable-from-php-to-second-swf/322669/1 "2011-05-29T20:05:47Z")

</div>

Hi,  
I’m having a problem with one of my flash websites and I’m hoping anyone has any suggestion on how to fix this.

The website is build from a main swf file. “main.swf” which is basically the backround with menu and the first thing that opens in index.html.  
Then there is a second flash. called login.swf which is loaded onto the main flash.  
The second flash is loaded using next code:

```auto
cont._lockroot = true;
cont.loadMovie("login.swf");

```

The second flash has a dynamic text box with a variable named “variable”  
the problem is that login.swf needs to access some variables in php.  
here is the code that is used to call .php and execute it.

```auto
loadVariablesNum("login.php", 0, "POST");

```

and here is the php line that gets executed in login.php file.

```auto
print "variable=random text.";

```

Basicaly when the flash executes itself it changes the text in dynamic text bot to “random text”. The problem is next. When login.swf is on its own the flash and php work perfect. But when flash is loaded in main.swf , php gets executed but the variable doesent change its value. Like php couldnt access the variable. or get past the main flash to the second one. I hope you get it 😃 I kinda explained this in a complicated way. 😃  
Thank you for your answers. :pleased:
