# AS#: Need Help With URLLoaderDataFormat

**URL:** <https://forum.kirupa.com/t/as-need-help-with-urlloaderdataformat/300627>\
**Category:** flash\
**Created:** [November 24, 2009, 9:56pm UTC](https://forum.kirupa.com/t/as-need-help-with-urlloaderdataformat/300627 "2009-11-24T21:56:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooterman42](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@rooterman42](https://forum.kirupa.com/u/rooterman42)\
**Post date:** [November 24, 2009, 9:56pm UTC](https://forum.kirupa.com/t/as-need-help-with-urlloaderdataformat/300627/1 "2009-11-24T21:56:41Z")

</div>

Hello,

I’m trying to get this to work, but when I trace the outgoing variables, characters are being replaced, such as underscores changing to %5F, and @ changing to %40. Here is my script:

//---------------Setup variables  
var loader:URLLoader = new URLLoader();  
var req:URLRequest = new URLRequest(“index.php”);  
var variables:URLVariables = new URLVariables();  
loader.dataFormat = URLLoaderDataFormat.TEXT;  
req.method = URLRequestMethod.POST;

//--------------Set listener fot textfield changes  
txEmail.addEventListener(Event.CHANGE, txErrorCheck);  
function txErrorCheck(event:Event):void {  
if (txError.text.length\>0) {  
txError.text = “”;  
}  
}

var varAction:String = “ext\_addcontact”;  
var varSelectedgroupname:String = “portal\_launch\_notification”;  
var varGroupownerid:Number = 21;

//--------------Set up form buttons  
butSend.addEventListener(MouseEvent.CLICK, sendForm);  
butSend.txTitle.text=“SUBMIT”;

//--------------Validate fields and submit form  
function sendForm(evt:MouseEvent):void {  
if (!txEmail.text.length || txEmail.text.indexOf("@") == -1 || txEmail.text.indexOf(".") == -1) {  
txError.text = “missing field/Invalid email”;  
} else {  
mcLoader.gotoAndPlay(2);  
variables.email = txEmail.text;  
variables.portal\_notification\_email = txEmail.text;  
variables.action = varAction;  
variables.selectedgroupname = varSelectedgroupname;  
variables.groupownerid = varGroupownerid;  
req.data = variables;  
loader.load(req);  
loader.addEventListener(Event.COMPLETE, messageSent);  
trace(“sendForm called”);  
}  
}

function messageSent(evt:Event):void {  
trace(txEmail.text);  
trace("returned value = " + evt.target.data);  
trace(variables);  
if (evt.target.data==0) {  
trace(“FAILED”)  
} else if (evt.target.data==1) {  
trace(“SUCCESS!!!”)  
}  
}

stop();

When I trace the outgoing variables, I get:

groupownerid=21&email=myname%40hotmial%2Ecom&action=ext%5Faddcontact&selectedgroupname=portal%5Flaunch%5Fnotification&portal%5Fnotification%5Femail=myname%40hotmial%2Ecom

Any help would be deeply appreciated!

r
