The following example shows how you can use the describeType() method to inspect a class’s accessor methods.
Full code after the jump.
Continue reading ‘Inspecting the properties in a class using the describeType() method and E4X/XML’
The following example shows how you can use the describeType() method to inspect a class’s accessor methods.
Full code after the jump.
Continue reading ‘Inspecting the properties in a class using the describeType() method and E4X/XML’
The following example shows you how you can display all the getters/setters and their current values for a Flex TextArea control by using the describeType() method, some E4X filtering, and an XMLListCollection.
Full code after the jump.
Continue reading ‘Displaying all the properties of a component instance in Flex’
In previous examples, “Creating a simple image gallery with the Flex TileList control” and “Creating a simple image gallery with the Flex HorizontalList control”, we saw how you could create a simple image gallery using the TileList and HorizontalList controls.
The following example shows how you can load XML files using the HTTPService tag so that you can dynamically load different galleries.
Full code after the jump.
Continue reading ‘Dynamically loading XML files using the HTTPService tag’
The following example shows how you can sort an XML document by converting it into an XMLListCollection and applying a sort. You can also easily reverse the current sort by calling the SortField object’s reverse() method and refreshing the XMLListCollection object.
Full code after the jump.
Continue reading ‘Sorting XML documents using 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’
I actually searched around and couldn’t find any other examples of this, but here is a quick example of using the <mx:Sort /> and <mx:SortField /> MXML tags in Flex to sort an XMLListCollection.
Full code after the jump.
Continue reading ‘Sorting an XMLListCollection using the mx:Sort and mx:SortField MXML tags’
Here is another handy little tip that you see all over the web, how do I filter a data grid (or other list-based control) based on a user’s input? Or more specificially, how to I limit the items that show in a list based on what a user types.
Since I already created a simple XML document of Countries/States, I thought I’d create a basic form that lets a user type in the first few characters of a state name and have the DataGrid filter its results. You’ll also notice that I had to do some not-so-tricky E4X filtering to extract only the American state names.
Full code after the jump.
OK, hopefully this example is a bit more interesting than a few of my previous ones. Today’s handy tip comes in the form of loading and embedding an XML file in our Flex application at compile-time (as opposed to dynamically loading at run-time, which we’ll save for a future example), and displaying that information in a DataGrid control.