AS3 load php variable in text field

Hello everybody.
I’m trying to make the day flash send the variables to a text field with as3.

AS3
//----------------------------------------------//

import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLLoaderDataFormat;
import flash.events.Event;

btn.addEventListener(MouseEvent.CLICK, klik);
function klik(e:MouseEvent):void{
var req:URLRequest = new URLRequest(“file.php”);
var loader:URLLoader = new URLLoader(req);
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, carregou);
}

function carregou(e:Event):void{
trace( e.target.data.username);
}

//----------------------------------------------

PHP
//----------------------------------------------

<?php

if (!$_POST[“username”]||$_POST[“username”]==“Mail”) $username=“Mail”.rand(100,99999);

else $username=$_POST[“username”];
$username=preg_replace("/[^0-9a-zA-Z]/","-",$username);
setcookie(“username”,urlencode($username),time()+36000);
?>

//----------------------------------------------

but the following error appears:

Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()

just need the username variable in the flash is received and displayed in text field.

would appreciate if someone could help me.
Thank you all.