Advertisement
kremisoski

Flex / Labels

Feb 13th, 2015
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 1.02 KB | None | 0 0
  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" creationComplete="init(event)">
  5.     <fx:Script>
  6.         <![CDATA[
  7.             import com.greensock.TweenLite;
  8.             import com.greensock.easing.Quart;
  9.             import mx.events.FlexEvent;
  10.            
  11.             private var myTween:TweenLite;
  12.            
  13.             protected function mc_CCHandler(event:FlexEvent):void
  14.             {
  15.                 TweenLite.from(mc, 1, {x:561, y:152, ease:Quart.easeIn});
  16.                 mc.text = "Some Other Label";
  17.             }
  18.            
  19.             protected function init(event:FlexEvent):void
  20.             {
  21.                 createTF();
  22.             }
  23.            
  24.             protected function createTF():void
  25.             {              
  26.                 var myText:Label = new Label();
  27.                 myText.text = "Some AS3 Label";
  28.                 myText.x = mc.x + mc.width + 50;
  29.                 addElement(myText);
  30.             }
  31.            
  32.         ]]>
  33.     </fx:Script>
  34.    
  35.     <!-- Components / MXML -->
  36.     <s:Label id="mc" text="Some Label" creationComplete="mc_CCHandler(event)" />
  37. </s:Application>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement