Do you want to create multiple tabs that look like the image below? Using Adobe Flex’s IDE called Flex Editor, you can easily drag ui components to the application area (the area colored gray). When I tried to add a canvas though to represent as another tab by dragging it to the application area, I hard somewhat of a hard time.

So what I did was code manually the MXML file. Just place the mx:Canvas tags inside the mx:TabNavigator and they will automatically be considered as tabbed panes.

Pretty easy. The labels that you assign in the Canvas component will be the text that will appear in the tab.

Ever had that problem when using the DateTimeAxis along a horitonzalAxis or verticalAxis and when you hover over your mouse, the dates are not displayed correctly? That’s what happened to me when I first checked on using charts. The DateTimeAxis has a parseFunction property that lets you specify the function to use to convert, say, String dates to Date objects. The problem I encountered was that the dates displayed in the chart were subtracted a day. If your date is October 28, 2008, the date displayed in the chart would be October 27, 2008. There are two ways to solve this problem.

Adding displayLocalTime="true" property in the DateTimeAxis

Or, using the code below to define your function to be used in the parseFunction to return a Date object

Oddly, Flex does not let you set an item to be selected in its ComboBox component. While the selectedIndex property can be used, you would have to make your own method to loop through the ComboBox’s dataProvider contents to get the index. Luckily, someone saved us the trouble of creating our own component extending ComboBox. Use the code below to be used as a substitute component for mx:ComboBox.

To use this custom made ComboBox, if your component file is under the folder com/ui/ then you have to specify it in the xml namespace. Setting the item in the ComboBox to be selected can be done by calling the selectedValue property (see code below).

Related Posts Plugin for WordPress, Blogger...