Hi guys,
just wondering how to pass data to a cairngorm event's 'data' object.
This is how I've seen it done in the past without using cairngorms
'data' object.
************************
// in the view...
public function loginHandler ( username : String, password : String):void
{
var login : LoginEvent = New LoginEvent();
login.username = username;
login.password = password;
CairngormEventDispatcher.getInstance().dispatchEvent(login);
}
************************
// but this requires declaring username and password in the loginEvent
// i.e. in the LoginEvent;
public class LoginEvent extends CairngormEvent
{
public var username : String;
public var password : String;
// etc.
}
*************************
how do I enter data from the view to the loginEvents built in data object?
i tried many things and they don't work including..
// in the view...
public function loginHandler ( username : String, password : String):void
{
var login : LoginEvent = New LoginEvent();
login.data.username = username;
login.data.password = password;
CairngormEventDispatcher.getInstance().dispatchEvent(login);
}
*************************
if I need to declare the data variables in the LoginEvent could you
also let me know how, It wouldn't accept what I was trying to enter
either.
thanks.
Phil