Skip to main content
Dec 9, 2011 12:58 AM UTC
Question

Subsribe to InlineGraphicElement mouse click

How can I implement this simple thing without getting list of all gaphic elements and adding listner to each? I can listen for mouse click event and get target as Loader which has parent.parent property as TextLine but I can't get InlineGraphicElement reference from it. Is there any functionality to determine which float element is under mouse pointer?

Best Regards, Aleksey

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

Participating Frequently
Dec 9, 2011 6:12 AM UTC

To listen all InlineGraphicElements' mouse click event, you can use FlowElementMouseEvent. Maybe as below code:  textFlow.getEventMirror().addEventListener(FlowElementMouseEvent.MOUSE_DOWN, eventCallbackFunction);  Then in the eventCallbackFunction, check if the target object is an inlineGraphicElement. Hope this helps.

Translate
Dec 9, 2011 12:01 PM UTC

Thanks for the answer but this does not work. getEventMirror returns null for TextFlow and I thought FlowElementMouseEvent are generated only for links, I can't apply links lin to images in my case.

Translate
Participating Frequently
Dec 12, 2011 3:11 AM UTC

Oops, right, FlowElementMouseEvent is for LinkElement. So you can add your InlineGraphicElement as a child of LinkElement, then register FlowElementMouseEvent to linkElement, then you can uses FlowElementMouseEvent for all your inlineGraphicElements.

Translate