In the tree's parent.
tree.addEventListener( TreeEvent.CHANGE, addProductToShoppingCart );



On 04/04/2007, at 4:18 AM, mapper2255 wrote:

Good Afternoon,

I know this has been asked before, I see 51 threads on "tree events
cairngorm" yet none seem to take the last step.

From this thread:
http://tech.groups.yahoo.com/group/flexcoders/message/51927 I
created a tree and have successfully passed the events. I do not
need at this time to add nodes, just that this code seemed like a
good basis to start.

I know from the documents/ProductDetails.mxml that I should be
looking to pass an event such as this:

public function addProductToShoppingCart () : void
{
var event : UpdateShoppingCartEvent =
new UpdateShoppingCartEvent(

UpdateShoppingCartEvent.EVENT_ADD_PRODUCT_TO_SHOPPING_CART );

event.product = selectedItem;
event.quantity = numericStepperComp.value;

CairngormEventDispatcher.getInstance
().dispatchEvent( event );
}       

which can then be used like this:

<mx:Button
label="Add to Cart"
click="addProductToShoppingCart();" />

Yet with the tree component having it's own event
(change="treeChanged(event)) how does one grab the change event to
dispatch a CairngormEventDispatcher?

Any help would be appreciated.

Thanks.




Reply via email to