This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 23rd, 2012  |  syntax: MXML  |  size: 1.61 KB  |  views: 93  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
  3.                            xmlns:s="library://ns.adobe.com/flex/spark"
  4.                            xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
  5.        
  6.         <fx:Script>
  7.                 <![CDATA[
  8.                         import spark.events.TextOperationEvent;
  9.                         protected function myButton_clickHandler(event:MouseEvent):void
  10.                         {
  11.                                 myLabel.text = ""
  12.                                 myInput.text =""
  13.                         }
  14.                        
  15.                         protected function myInput_changeHandler(event:TextOperationEvent):void
  16.                         {
  17.                                 myLabel.text=myInput.text
  18.                         }
  19.                        
  20.                         protected function myButton2_clickHandler(event:MouseEvent):void
  21.                         {
  22.                                 currentState="Drugi"
  23.                         }
  24.                        
  25.                 ]]>
  26.         </fx:Script>
  27.        
  28.         <fx:Declarations>
  29.                 <!-- Place non-visual elements (e.g., services, value objects) here -->
  30.         </fx:Declarations>
  31.         <s:states>
  32.                 <s:State name="Pierwszy"/>
  33.                 <s:State name="Drugi"/>
  34.         </s:states>
  35.         <s:Panel includeIn="Pierwszy" x="231" y="135" width="351" height="246">
  36.                 <s:Button id="myButton" x="74" y="33" label="Button" click="myButton_clickHandler(event)"/>
  37.                 <s:Label id="myLabel" x="220" y="28" width="89" height="26" fontSize="14" text="Label"/>
  38.                 <s:TextInput id="myInput" x="74" y="0" change="myInput_changeHandler(event)"/>
  39.                 <s:Button id="myButton2" x="51" y="159" label="Button" click.Pierwszy="myButton2_clickHandler(event)"/>
  40.         </s:Panel>
  41.         <s:Panel includeIn="Drugi" x="231" y="135" width="351" height="246" backgroundColor="#656FB2"
  42.                          chromeColor="#874444">
  43.                 <s:Button x="51" y="159" label="Button" chromeColor="#933434" click="currentState='Pierwszy'"
  44.                                   focusColor="#1464AE"/>
  45.         </s:Panel>
  46.        
  47. </s:Application>
clone this paste RAW Paste Data