Sometimes you need to know when there is a mouse click in your Flex application.
Instead of listen to all the components you just can add the next listener:
systemManager.getSandboxRoot().addEventListener(MouseEvent.CLICK, onApplicationMouseClick);
private function onApplicationMouseClick(event:MouseEvent):void
{
//your code
}
Note: When the user prevents the default behaviour (event.preventDefault) of a mouse click event, the code above will not be triggered.
If you have a Flex list (List, DataGrid, TileList or whatever) that is drag enabled, you don’t always want that each item of the list is draggable.
It should be very handy if Flex offers some kind of filter function that decides which items are draggable and which aren’t. Unfortunately such a function is not available yet.
The easiest way to prevent the dragging at this time is to listen to the dragStart event and prevent the default behavior when the item is not allowed to be dragged.
Read more…
Recent Comments