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 how you can parse an XML node with a dash in its node name (<font-family />) as well as parsing an Object with a dash in it’s identifier using the square bracket notation ([]).
Full code after the jump.
Continue reading ‘Parsing XML nodes and Objects with dashes in their names in ActionScript 3.0′
The following example shows how you can set the amount of indentation used when calling the toXMLString() method by setting the static XML.prettyIndent property in ActionScript.
Full code after the jump.
The following example shows how you can ignore comment tags (<!-- … -->) in an XML document by setting the static XML.ignoreComments property.
Full code after the jump.
Continue reading ‘Ignoring comments in an XML file in ActionScript 3.0′
The following example shows how you can get the XML class’s current settings by calling the static XML.settings() method.
Full code after the jump.
Continue reading ‘Determining the XML class’s settings in ActionScript 3.0′
The following example shows you how to use the Repeater component to display images loaded from an external XML file.
Full code after the jump.
Continue reading ‘Displaying images from an XML file using the Repeater component’
Similar to the previous post, “Converting XML to objects using the Flex HTTPService MXML tag“, the following example shows how you can use the decodeXML() method in the SimpleXMLDecoder class to convert an XMLDocument object into an ActionScript Object object.
Full code after the jump.
Continue reading ‘Converting XML to objects using the Flex SimpleXMLDecoder class’
The following example shows how you can convert an XML file loaded at run-time using the HTTPService tag, into an ActionScript Object by simply setting the resultFormat property to “object”.
Full code after the jump.
Continue reading ‘Converting XML to objects using the Flex HTTPService MXML tag’
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.
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’
This is a semi-common problem. You have two (or more) ComboBox controls and you want the options in second combo box to change based on the selected item in the first combo box. Or in a real world case, you have a list of countries and a list of provinces/states/regions in that country. When the user changes the value in the country combo box to “Canada”, you would only want to display a list of Canadian provinces/territories in the second combo box. Although if the user selected USA in the country combo box, you would only want to show the American states/regions.
Anyways, enough jibber-jabber, lets see this in action.
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.