flash on 2011-8-22

by cdubois75
♥0 | Line 31 | Modified 2011-08-23 00:12:38 | MIT License
play

ActionScript3 source code

/**
 * Copyright cdubois75 ( http://wonderfl.net/user/cdubois75 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/jIRV
 */

<?xml version="1.0" encoding="utf-8"?>
<!-- security/SecurityErrorExample.mxml -->
<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009"    
    xmlns:mx="library://ns.adobe.com/flex/mx"     
    xmlns:s="library://ns.adobe.com/flex/spark">


    <fx:Script><![CDATA[
        private var aryTest:Object = {F_NAME:"Craig",M_NAME:"Richard",L_NAME:"DuBois"};
        
        private function clickMe():void
        {
            lblDisplay.text = aryTest[txtInput.text];
        }
        
        private function pushValue():void
        {
            aryTest.push(txtInput.text);
            lblDisplay.text = "Pushed " + txtInput.text + " into array at index: "
                            + (aryTest.length - 1);
        }



    ]]></fx:Script>

    <s:Panel title="My Test App" width="75%" height="75%">
      
       <s:Group x="10" y="10">
       <s:layout> 
          <s:VerticalLayout/> 
       </s:layout>
       
       
       <s:Label id="lblDisplay"/>
       <s:TextArea id="txtInput" height="20"/>
       <s:Button label="Click to access array" click="clickMe()"/>
       <s:Button label="Push into array" click="pushValue()"/>
       </s:Group>
    </s:Panel>
</s:Application>