# Problem Loading php variables into Flash?

**URL:** <https://forum.kirupa.com/t/problem-loading-php-variables-into-flash/277707>\
**Category:** flash\
**Created:** [December 16, 2008, 6:20am UTC](https://forum.kirupa.com/t/problem-loading-php-variables-into-flash/277707 "2008-12-16T06:20:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![roll4dasoul](https://avatars.discourse-cdn.com/v4/letter/r/8dc957/32.png) [@roll4dasoul](https://forum.kirupa.com/u/roll4dasoul)\
**Post date:** [December 16, 2008, 6:20am UTC](https://forum.kirupa.com/t/problem-loading-php-variables-into-flash/277707/1 "2008-12-16T06:20:21Z")

</div>

Hello, I’m having an issue loading variables from a php file into flash with actionscript 3.0  
I am able to reference the php file and trace all the data, but not certain variables.

This is my php code:

```php
<?php
$username = "joe";
$username2 = "joey";

echo "username=" .$username;

?>

```

and this is the actionscript I’m using:

```php
var request:URLRequest = new URLRequest("php/copyright.php");
var loader:URLLoader = new URLLoader();
loader.load(request);

loader.addEventListener(Event.COMPLETE, completeHandler)
function completeHandler(event:Event):void{
	var variables:URLVariables = new URLVariables(loader.data);
	trace(variables.username);
	}

```

In the output panel I get a message saying the username is undefined?

Any help would be great

Thanks,  
Chris Fleming
