Skip to main content
December 9, 2011
Question

Subsribe to InlineGraphicElement mouse click

  • December 9, 2011
  • 1 reply
  • 1257 views

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 has been closed for replies.

1 reply

Participating Frequently
December 9, 2011

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.

December 9, 2011

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.

Participating Frequently
December 12, 2011

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.