In a previous example, “Converting XML to objects using the Flex SimpleXMLDecoder class”, we saw how to convert an XML instance into an Object instance using the SimpleXMLDecoder class and decodeXML() method.
The following example shows how you can convert an array of objects into an XML object using the SimpleXMLEncoder class and encodeValue() method in Flex.
Full code after the jump.
Continue reading ‘Converting objects to XML packets using the SimpleXMLEncoder class in Flex’
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.
Continue reading ‘Parsing the Kuler RSS feed using Flex’
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’
In the previous post we looked at how to load an XML document in at compile-time and have it embedded in our Flex application. But that technique really only works if the XML data in question never changes. What if you had an XML document that was constantly changing on a daily, or hourly, basis. For example, consider an RSS reader application. If the XML was loaded and embedded in the XML document at compile-time, the RSS would never get updated. And while that may be good in some cases (such as a kiosk, or somewhere without an internet connection where you wanted to display static information), in many cases it may not work.
So, lets take a look at using the mx:HTTPService tag to dynamically load an XML file.
Continue reading ‘Loading XML at run-time using the mx:HTTPService tag’
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.
Continue reading ‘Displaying XML data in a DataGrid’