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().

 
Tagged with:
 
About The Author

Peter deHaan

Peter deHaan currently works for Adobe on the Flex SDK QA team. While not working on Flex, Flash, and ColdFusion applications, Peter enjoys making up bios and writing in 3rd person. Peter's rarely updated blog can be found at blogs.adobe.com/pdehaan/, actionscriptexamples.com, airexamples.com, and coldfusionexamples.com.

0 Responses to Determining the XML class’s settings in ActionScript 3.0

  1. Gareth Arch says:

    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?

  2. peterd says:

    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

Leave a Reply

Your email address will not be published.

You may 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