Hey everybody) I need help with the understanding of the framework Cairngorm for flex.
I code a simple application slider. I have a main class in which I have a tag
<fx:Declarations>
<control:AppController id="appController" />
</fx:Declarations>
Class itself AppController extends FrontController with constructor function:
public function AppController()
{
addCommand(SliderEvent.BUILD, SliderBuildCommand);
addCommand(SliderEvent.TRANSITION, SliderTransitionCommand);
}
and finally the code of SliderBuildCommand class:
public function SliderBuildCommand(){}
public function execute(event:CairngormEvent):void
{
config.loadSlides(this);
}
Unfortunately, in debugging, I see that the addition of the command didn't work out. This can be seen if set a breakpoint in "сonfig.loadSlides(this)" line. However, the command (addCommand) is processed. Any idea why this is happening? Maybe I am a noob and I don't see the obvious :)
Instead of adding/mapping commands in
AppController
's constructor. Declare it ininitialize()
function. Example is given below for your reference.