House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  Adobe Flex

how to catch a dynamically created custom component's event?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Yuliang Ruan
02/05/2010 11:29 AM

What I have is a wrapper custom component as a Canvas containing a DataGrid with a custom item renderer in the 1st column.   I'm inserting DataGridColumns into the DataGrid upon Canvas creationComplete.    Inside my expandBtnRenderer, I have it dispatchEvent("expandBtnPressed",new Event("expandBtnPressed")); question is....where do i add the eventListener for my custom event "expandBtnPressed" ?   my Canvas component: private function init():void {   var myXBRFactory:ClassFactory=new ClassFactory(expandBtnRenderer);   var newDGC:DataGridColumn=new DataGridColumn("expand");   newDGC.itemRenderer=myXBRFactory;   var newCols:Array=new Array();   newCols.push(newDGC);   dgHeader.columsn=newCols; } <mx:DataGrid id="dgHeader" dataProvider="{dataProvider}"/>

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Yuliang Ruan
02/05/2010 01:06 PM

n/m figured it out.   you add it to the current component.  so my canvas component addEventListener("expandBtnPressed",myhandler);


<< Previous Thread Today's Threads Next Thread >>

Search flex

March 20, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31