Read up on event life cycle, specifically about capture, target and bubble
phases.
dispatchEvent(new Event(eventType)); will dispatch the event.
But since it's a renderer (let's say a datagrid renderer for example sake),
the only way for you to listen for the event is on the datagrid itself, i.e.
datagrid.addEventListener(eventType, handlerFunction);

Adding the event listener like this is listening for events from the given
type, *dispatched from the datagrid*, but it's your renderer that is
dispatching the event, not the datagrid...

The way to make this work, is dispatch it from the renderer with bubbling -
which will make it bubble up the display list heirarchy renderer->datagrid
->etc... and will make your handler catch the event.

So, a long story short, dispatch the event from the renderer like this:
dispatchEvent(new Event(eventType, true));

But you should really read up on event phases

2009/7/5 j2me_soul <[email protected]>

>
>
> How can let the parent of itemrenderer know something is happened ?
> I use dispatchevent function, but it doesn't work.
>
>
>
> ------------------------------
> 200万种商品,最低价格,疯狂诱惑你<http://count.mail.163.com/redirect/footer.htm?f=http://gouwu.youdao.com>
> 
>

Reply via email to