Determining the XML class’s settings in ActionScript 3.0

by Peter deHaan on August 22, 2008

in ActionScript, XML

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.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/08/22/determining-the-xml-classs-settings-in-actionscript-30/ -->
<mx:Application name="XML_settings_test"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:Script>
        <![CDATA[
            import mx.utils.ObjectUtil;

            private function init():void {
                var obj:Object = XML.settings();
                textArea.text = ObjectUtil.toString(obj);
            }
        ]]>
    </mx:Script>

    <mx:TextArea id="textArea"
            editable="false"
            width="100%"
            height="100%"
            creationComplete="init();" />

    <mx:Label text="{Capabilities.version}" />

</mx:Application>

View source is enabled in the following example.

For more information on the XML class’s settings() method, see the Flex 3 documentation at http://livedocs.adobe.com/flex/3/langref/XML.html#settings().

{ 2 comments… read them below or add one }

1 Gareth Arch August 25, 2008 at 6:51 am

Not sure why, but the example shows “The content requires Adobe Flash Player 9″, but I have Flash 9 (debug) installed currently (From adobe.com “You have version 9,0,115,0 installed”). Is there a more specific requirement for this?

Reply

2 peterd August 25, 2008 at 7:09 am

Gareth Arch,

Sorry, I built this example with Flex Builder 3.0.1 and I think the detection is set for Flash Player 9,0,124,0 by default.

You may need to download the latest version of Flash Player 9 (or Flash Player 10 beta) to see the latest examples: http://www.adobe.com/go/getflashplayer

Sorry about that,
Peter

Reply

Leave a Comment

Sorry, this blog is terrible at eating HTML comments.
If you're pasting any HTML/XML/MXML code, you need to convert your < characters to &lt; and your > characters to &gt; .

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree

Previous post:

Next post: