Cairngorm !!!!!!!!! I am New It and was looking for listening event in
view to change style of my flex application, after lot of trying i
found out its fairly simple.

Write on the top of command:

[Event(name="enableChange",
type="com.adobe.cairngorm.control.CairngormEvent")]

Result Method of Command:

public function result(data:Object):void
{
var e:CairngormEvent=new CairngormEvent("enableChange");
CairngormEventDispatcher.getInstance().dispatchEvent(e);
}


Listen for that in a view :

<mx:application
height="100%"
creationComplete="creationComplete()"
layout="absolute" backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#FFFFFF, #FFFFFF]"
xmlns:components="components.*"
xmlns:business="business.*"
xmlns:view="view.*"
xmlns:control="control.*">

<mx:script>
import com.adobe.cairngorm.control.CairngormEventDispatcher;
import mx.controls.Alert;
import com.adobe.cairngorm.control.CairngormEvent;

import flash.events.Event;


private function creationComplete ():void {
CairngormEventDispatcher.getInstance().addEventListener
("enableChange", enableChangedListener);
}



public function enableChangedListener(eventOb:CairngormEvent):void {
Alert.show("Handle Event", "Catch");
// Handle event.
}
</mx:script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to