Archive for August 22nd, 2007

22
Aug

Sorting and filtering data in an XMLListCollection

The following code is a brief example of sorting a Flex XMLListCollection using the Sort and SortField classes, and the XMLListCollection.sort property. We also look at filtering the XMLCollection using a custom filter function.

Full code after the jump.

Continue reading ‘Sorting and filtering data in an XMLListCollection’

22
Aug

Validating data using Regular Expressions

It looks like I forgot to post this and I’ve had this as a draft for a week. I was looking at creating a regular expression for validating a UPS tracking number and/or InfoNotice number and decided to do a quick RegExp for validating a Canadian postal code instead. Fear not, my 3 loyal readers, I’ll post the other regular expressions later on.

Full code after the jump.

Continue reading ‘Validating data using Regular Expressions’

22
Aug

Using the TitleWindow container to display status messages

Another example of something I’ve seen lately on the Internet, so I thought I’d build it in Flex. This time I usea TitleWindow to display the status message of a login form. You can close the message by clicking the X button in the upper-right corner of the title window.

Note that there is no correct login. It will display the error message every time. In a future example I’ll try and add some fancy fade in/out effects or resize effects on the error message to give it that proper “Web 2.0 feel”.

Full code after the jump.

Continue reading ‘Using the TitleWindow container to display status messages’

22
Aug

Using named groups with Regular Expressions

This is always a neat trick that I seem to always forget about, so I thought I’d post it here. When working with Regular Expressions, the RegExp class supports named groups. So instead of having to go through the RegExp result and access it like an array ([1], [2] .. [n]), you can use named results. Long story short, it can make working with the results a bit more intuitive. I made a simple example below which parses the user’s Flash Player version and displays the operating system/platform, major revision, minor revision, build number and internal build number.

Full code after the jump.

Continue reading ‘Using named groups with Regular Expressions’

22
Aug

Using overlapping slider thumbs in the Flex Slider controls

I was playing around with the HSlider component tonight and was checking out the allowThumbOverlap property. The following example creates a horizontal slider with 2 slider thumbs and lets you toggle the allowThumbOverlap property with the showTrackHighlight property set to true.

Full code after the jump.

Continue reading ‘Using overlapping slider thumbs in the Flex Slider controls’

22
Aug

Creating a vertical ToggleButtonBar in Flex

The following example creates a ToggleButtonBar control in Flex and sets its toggleOnClick property to true.

According to the Flex 2.0.1 documentation:

If you set the toggleOnClick property of the ToggleButtonBar container to true, selecting the currently selected button deselects it. By default the toggleOnClick property is set to false.

You can check out the different behaviors of the toggleOnClick property by selecting or deselecting the check box in the upper left corner. Likewise, you can change the ToggleButtonBar control’s direction property by changing the selected value in the combo box in the upper-right corner. If the toggleOnClick property is set to true and you deselect a button in the ToggleButtonBar control, the ToggleButtonBar control’s selectedIndex property is set to -1 and the Flex application sets the ViewStack container’s visible property to false.

Full code after the jump.

Continue reading ‘Creating a vertical ToggleButtonBar in Flex’

22
Aug

Parsing the Kuler RSS feed using Flex

Just a quick example I threw together last night which loads the Kuler RSS feed and displays some items in a DataGrid along with their rating and theme image (using the Flex Image control as a custom item renderer).

Full code after the jump.

Continue reading ‘Parsing the Kuler RSS feed using Flex’




Badge Farm

  • Firefox 2
  • Powered by Redoable 1.2
  • Feeds burnt by Feedburner
  • Feed