Variables with URLLoader

Heyaaa people,

It has been to long that i’ve been here, last post dates from 2005 :cantlook:

Recently i got job that finaly includes some AS3, so im getting back into the world of flash again. But as you all can imagen, not without problems… let me explain what i’m trying to get working:

A little background:
We are currently recreating a game within flash, the game requires a login to create a sessionid (server side) to retrieve gamedata based on that sessionid. The login page for this, is done with a certain framework (cake), wich we are not going to change, because the existing game is already in production phase.

The problem:
The original form sends the username and password with nested variables like this:

<input id=“LoginUsername” type=“text” value=“” maxlength=“40” name=“[COLOR=“Red”]data[Login][username][/COLOR]”/>
<input type=“password” id=“LoginPassword” value=“” name=“[COLOR=“Red”]data[Login][password][/COLOR]”/>

AS3
Trying to replicate the request in as3 like this:
[AS]
public function login(username:String, password:String):void{
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(this.baseUrl + this.loginPath);
var variables:URLVariables = new URLVariables();
variables.data[‘Login’][‘username’]=username;
variables.data[‘Login’][‘password’]=password;
request.method = URLRequestMethod.POST;
request.data = variables;
loader.load(request);
loader.addEventListener(Event.COMPLETE, onLogin);
}
[/AS]
but ofcourse, this isn’t working, giving me the error on the variables.data line

[COLOR=“Red”]TypeError: Error #1010: A term is undefined and has no properties.[/COLOR]

wich is understandable… because variables.data doesn’t have properties, but i have no idea how to do it the right way…

someone has to clear my mind on this, its killing me :h: