Greg -

I suspect that your Alert in initMe() is showing null because "evt as String" cannot simply convert a CairngormEvent to a String. Beyond that, it appears to me that you could benefit from a quick read through of this excellent set of articles on Cairngorm <http://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html> in order to better understand the flow. It does a really great job of describing how to setup your ModelController, how to bind your views to it, and how to use the FrontController to map CairngormEvents to Command classes that handle them in order to update the model.

hth
Scott

Greg Morphis wrote:

in my application. mxml I have a creationcomplete function initMe()
which is suppose to create an event and send it to Cairngorm but it's
not returning data, no errors though either, I don't know where to
check for data to see if it's making it to a certain point..

The initMe looks like...

import com.control. MyControl;

public function initMe():void {
var evt:CairngormEvent = new CairngormEvent( MyControl.EVENT_ LOAD_DATA );
Alert.show(evt as String); // returns a null Alert
CairngormEventDispa tcher.getInstanc e().dispatchEven t(evt);
}

in MyControl.as I have
public function MyControl()
{
addCommand(MyContro l.EVENT_LOAD_ DATA,LoadDataCom mand );
... other events

}

//cairngorm event names
public static const EVENT_LOAD_DATA: String = 'loadData';
... others

}

the loadcommand. as looks like
....
public function execute(event: CairngormEvent) :void {
Alert.show(' here');
var del:MyDelegate = new MyDelegate(this) ;
del.loadData( );

}

But the Alerts aren't firing... The one in initMe() is but it's empty..
Perhaps I'm not following the flow correctly?
Could someone assist me in where to look and how (Alerts?) for data
hitting an .as file or the back end?


Reply via email to