This content has been marked as final. Show 2 replies
Use the event handling mechanism. You can make your custom item renderer to listen to a custom event. In the event handler call the function, which you want to call. Dispatch this custom event, when ever you want to invoke the function in your customer renderer.
Hope this helps.
Hi SujitG, thanks for the reply.
My understanding of event bubbling is that an event only bubbles up the parent's chain of ancestors in the display list. Siblings, such as two controls inside the same container, do not intercept each other's events.
So, the item renderer could not intercept the event from the sibling control (in this case it's a videodisplay).
But your answer is on the right track, if only part of the way there.
The way I have solved it so far, is to have the videodisplay dispatch a custom event. I added an event listener to the canvas that contains the tilelist and the videodisplay. Since the canvas is a parent to the videodisplay, it has no trouble capturing the event that is bubbled up to it. The next step is to then have the event handler located in the parent canvas call the function in the item renderer.
The answer that I am looking for is, How do I call a function in the itemrenderer of the tilelist from the parent container?
I expect the answer will be something like: myTileList.ItemRenderer .somePublicFunction();