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.
This is how you add a line to your Flex Spark skin without using a Rectangle (Rect) its strokes.
In this case a horizontal line will be drawn on the bottom of your skin.
<s:Line left="0"
right="0"
bottom="1">
<s:stroke>
<s:SolidColorStroke color="0xFAFAFA"
weight="1"/>
</s:stroke>
</s:Line>
When your Flex application needs an editable datagrid, you mostly add some itemEditors or itemRenderers to change the data.
You can find a lot of samples on the web, although it is not always that easy as most of them show.
This post shows a solution when you need an itemEditor that needs data different from the itemEditor its data property.
You can see an example of this blog post behind this link.
Read more…
Today I had to create an editable datagrid in my Flex application. Once a property of a row was edited, the edited item must be saved to the database.
I didn’t expect much trouble, although I get stuck with a really annoying Flex issue.
I added a listener to the dataGrid its itemEditEnd event, so I could save the item in the listener function.
For some reason, the item its property was not yet changed when the event was dispatched.
I looked for some relevant event properties, but nothing useful found.
After a while I solved it by adding a callLater in the listener. A timeOut or a callLater is not my favorite way of working, but I didn’t found a better solution.
I uploaded a sample.
Please feel free to add a better solution!
After updating to Firefox 3.6, my Flex applications received unwanted scrollbars after clicking (activating) them.
Firefox 3.6 will draw a 1 pixel ‘focus’ border around the Flash player.
To avoid this issue, just add the following css to your index.template.html.
a:focus, object:focus { outline: none; -moz-outline-style: none; }
For more information : http://www.flashcomguru.com/index.cfm/2010/3/22/prevent-swf-border-firefox
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…
If you want to update a datetime field in a mysql table by adding some extra hours for example you can use the next statement:
UPDATE table_name SET column_name = ADDTIME(column_name, '9:0:0')
This will add 9 hours to each row of the table. Read more…
From now on it is possible to e-mail your team members in Syncerd.
Just click the e-mail button and you can select the group you want to send an e-mail.
If you want to be more specific, you can select an activity and filter the recipients on status.
Enjoy!
When your list or datagridColumn has an itemRenderer with a component that can be clicked, you don’t always want to select the row in your list.
To prevent the selection, you need to listen to the mouseDown event and stop the propagation (event.stopPropagation()). Read more…
If you want to interact on the double click event on a UIComponent, you need to enable the “doubleClickEnabled” property. Read more…
Recent Comments