sending variables, the new way.

do you remember the time when if you need mimic a form behavior or send variables through the http, you just needed to grab a loadVars ojbect, and toss in all the things you wanna send and the just send it?, well, those times are gone, there is a couple of things that have changed.

This is how the whole thing used to look like.

var myVars:LoadVars = new LoadVars();
myVars.varA = "someValue";
myVArs.varB = "anotherValue";
myVars.send( someURL, "_self", "POST");

Well, the gang is a little bigger now, it seems to be a two men job now.
here is now the recipe looks:

var params:URLVariables = new URLVariables();
params.varA = "someValue";
params.varB = "anotherValue";

var urlRequest:URLRequest = new URLRequest(someURL);
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = params;

navigateToURL(urlRequest,"_self");

First you create a URLVariables Object and put the variables/properties there, then create a URLRequest object and assign its data property to be the URLVariables object you just created, set the urlRequest method, and then, if you use navigateToUrl, using this URLRequest object as argument, it will send the variables via http, while redirecting to that url (leaving the application), which in our case that was what we wanted to do.

We tried using httpService but since it was requesting a crossdomain policy file on the other end -even thought we just wanna send variables-, we decide to try another thing, glad for us F1 did the job.

So, I'm putting this over here for a couple of reasons,
a.- to let you know, i'm not dead yet
b.- in case some else find this info useful.
c.- for future reference, keep thing in a place easy to reach

pura vida.