SHARE
TWEET

jloa | AlignUtil test (scale & rotate)

a guest Mar 16th, 2011 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3.                                 layout="absolute"
  4.                                 applicationComplete="init()">
  5.        
  6.         <mx:Script>
  7.                 <![CDATA[
  8.                         import com.chargedweb.utils.AlignUtil;
  9.                        
  10.                         private function init():void
  11.                         {
  12.                                 AlignUtil.setAlign(AlignUtil.V_BOTTOM, bBtn, aBtn);
  13.                                 AlignUtil.setAlign(AlignUtil.V_BOTTOM, cBtn, aBtn);
  14.                                 AlignUtil.setAlign(AlignUtil.V_BOTTOM, dBtn, aBtn);
  15.                                
  16.                                 AlignUtil.setAlign(AlignUtil.H_RIGHT, bBtn, aBtn);
  17.                                 AlignUtil.setAlign(AlignUtil.H_RIGHT, cBtn, aBtn);
  18.                                 AlignUtil.setAlign(AlignUtil.H_RIGHT, dBtn, aBtn);
  19.                         }
  20.                 ]]>
  21.         </mx:Script>
  22.         <mx:Button x="0" y="0" width="400" height="400" id="aBtn" label="A"/>
  23.         <!-- now we set x,y scales to 2 and 3, and rotate the button, and it aligns as expected -->
  24.         <mx:Button x="260" y="260" label="B" id="bBtn" scaleX="2" scaleY="3" rotation="45"/>
  25.         <mx:Button x="308" y="260" label="C" id="cBtn"/>
  26.         <mx:Button x="356" y="260" label="C" id="dBtn"/>
  27. </mx:Application>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top