Hi
Is there any easy way to detect click outside of RichTextEditable? just like FlexMouseEvent.MOUSE_DOWN_OUTSIDE is used in popups.
Thanks
Hi
Is there any easy way to detect click outside of RichTextEditable? just like FlexMouseEvent.MOUSE_DOWN_OUTSIDE is used in popups.
Thanks
Hi,
I'm not sure if you mean the Spark RichEditableText
component or the Halo RichTextEditor
but they both dispatch the FlexMouseEvent.MOUSE_DOWN_OUTSIDE
event.
If you have MXML you can listen for it like:
<mx:RichTextEditor id="myText" mouseDownOutside="mouseDownOutsideFunction(event)" />
or from ActionScript like:
myText.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE,mouseDownOutsideFunction);
Hope that helps.
My approach to this would be to attach event listeners for MouseEvent.MOUSE_DOWN and SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE to the systemManager like so:
systemManager.getSandboxRoot().addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
systemManager.getSandboxRoot().addEventListener(SandboxMouseEvent.MOUSE_DOWN_SOMEWHERE, onMouseDown);
This way you get notified of any mouse down events and you can check to see if the event is happening inside of your RichEditableText component or not.
Hope that helps.