Archive

Archive for June, 2010

Listen to every mouse click in your Flex application

June 8th, 2010 Wannes No comments

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.

Add a line or stroke to a Spark skin

June 3rd, 2010 Wannes No comments

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>
Categories: Flex, Spark Tags: , , ,

Provide a Flex itemEditor with dynamic data

June 2nd, 2010 Wannes 2 comments

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…

Categories: Flex Tags: , , ,