<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Resize Text Field &#8211; AS3 Draggable Resizable Input Text Field</title>
	<atom:link href="http://moonpixel.com/resize-text-field-as3-draggable-resizable-input-text-field/feed/" rel="self" type="application/rss+xml" />
	<link>http://moonpixel.com/resize-text-field-as3-draggable-resizable-input-text-field/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 20 Jul 2010 18:38:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: moonpixel</title>
		<link>http://moonpixel.com/resize-text-field-as3-draggable-resizable-input-text-field/comment-page-1/#comment-648</link>
		<dc:creator>moonpixel</dc:creator>
		<pubDate>Tue, 20 Jul 2010 18:31:38 +0000</pubDate>
		<guid isPermaLink="false">http://moonpixel.com/?p=72#comment-648</guid>
		<description>Hi Dijup, nice one, I did give your class a go...</description>
		<content:encoded><![CDATA[<p>Hi Dijup, nice one, I did give your class a go&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dijup Tuladhar</title>
		<link>http://moonpixel.com/resize-text-field-as3-draggable-resizable-input-text-field/comment-page-1/#comment-642</link>
		<dc:creator>Dijup Tuladhar</dc:creator>
		<pubDate>Tue, 20 Jul 2010 09:06:40 +0000</pubDate>
		<guid isPermaLink="false">http://moonpixel.com/?p=72#comment-642</guid>
		<description>I have made some update to this code still many things need to be fixed to make this work properly

&lt;pre lang=&quot;actionscript3&quot;&gt;
package resizemc{
 
	import flash.display.Sprite;
	//for text format
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	import flash.text.TextFieldType;	
	import flash.text.AntiAliasType;
	
	import flash.events.MouseEvent;
	import flash.events.FocusEvent;
	import flash.utils.Timer;
	import flash.events.TimerEvent;
 
	public class ResizableTextField extends Sprite {
 
		private var textCustomField:TextField;
 
		//handles
		private var square1:Sprite;
		private var square2:Sprite;
		private var square3:Sprite;
		private var square4:Sprite;
		private var square5:Sprite;
		private var square6:Sprite;
		private var square7:Sprite;
		private var square8:Sprite;
 
		//dragging
		private var origX:int;
		private var origY:int;
		private var dragTimer:Timer = new Timer(10,10000);
		private var handleHolder:Object;
		private var txtClicked:Boolean = false;
		
		//text format
		public var myFont = new Font1();
		private var myFormat:TextFormat = new TextFormat();
 
		// Initialization:
		public function CreateTextField()
		{
			
		}
		public function ResizableTextField()
		{
			//text format set
			myFormat.size = 15;
			myFormat.font = myFont.fontName;

			textCustomField = new TextField();
			textCustomField.defaultTextFormat = myFormat;
			
			textCustomField.embedFonts = true;
			textCustomField.antiAliasType = AntiAliasType.ADVANCED;
			textCustomField.type = TextFieldType.INPUT;
			textCustomField.multiline = true;
			textCustomField.wordWrap = true;
			textCustomField.width=200;
			textCustomField.height=100;
			textCustomField.x=50;
			textCustomField.y=50;
			textCustomField.text=&quot;Type here&quot;;
			textCustomField.border=true;
			textCustomField.borderColor=0x32B5FE;
			createHandles();
			this.addChild(textCustomField);
			textCustomField.addEventListener(MouseEvent.CLICK,txtClick) 
		}
		
		//remove type here text
		private function txtClick(event:MouseEvent):void
		{
			if(txtClicked == false)
			{
			event.target.text = &quot;&quot;;
			txtClicked = true;
			}
		}

		
		//create 4 draggable handles
		private function createHandles():void
		{
 
			square1 = new Sprite();
			square1.graphics.lineStyle(1,0x32B5FE);
			square1.graphics.beginFill(0xFFFFFF);
			square1.graphics.drawRect(0,0,4,4);
			square1.graphics.endFill();
 
			square2 = new Sprite();
			square2.graphics.lineStyle(1,0x32B5FE);
			square2.graphics.beginFill(0xFFFFFF);
			square2.graphics.drawRect(0,0,4,4);
			square2.graphics.endFill();
 
			square3 = new Sprite();
			square3.graphics.lineStyle(1,0x32B5FE);
			square3.graphics.beginFill(0xFFFFFF);
			square3.graphics.drawRect(0,0,4,4);
			square3.graphics.endFill();
 
			square4 = new Sprite();
			square4.graphics.lineStyle(1,0x32B5FE);
			square4.graphics.beginFill(0xFFFFFF);
			square4.graphics.drawRect(0,0,4,4);
			square4.graphics.endFill();
			
			square5 = new Sprite();
			square5.graphics.lineStyle(1,0x32B5FE);
			square5.graphics.beginFill(0xFFFFFF);
			square5.graphics.drawRect(0,0,4,4);
			square5.graphics.endFill();
 
			square6 = new Sprite();
			square6.graphics.lineStyle(1,0x32B5FE);
			square6.graphics.beginFill(0xFFFFFF);
			square6.graphics.drawRect(0,0,4,4);
			square6.graphics.endFill();
 
			square7 = new Sprite();
			square7.graphics.lineStyle(1,0x32B5FE);
			square7.graphics.beginFill(0xFFFFFF);
			square7.graphics.drawRect(0,0,4,4);
			square7.graphics.endFill();
 
			square8 = new Sprite();
			square8.graphics.lineStyle(1,0x32B5FE);
			square8.graphics.beginFill(0xFFFFFF);
			square8.graphics.drawRect(0,0,4,4);
			square8.graphics.endFill();
 
			updateHandlePositions();
 
			this.addChild(square1);
			square1.buttonMode=true;
			this.addEventListener(FocusEvent.FOCUS_OUT,hideHandles);
			square1.addEventListener(MouseEvent.MOUSE_DOWN,startHandleDrag);
 
			this.addChild(square2);
			square2.buttonMode=true;
			this.addEventListener(FocusEvent.FOCUS_OUT,hideHandles);
			square2.addEventListener(MouseEvent.MOUSE_DOWN,startHandleDrag);
 
			this.addChild(square3);
			square3.buttonMode=true;
			this.addEventListener(FocusEvent.FOCUS_OUT,hideHandles);
			square3.addEventListener(MouseEvent.MOUSE_DOWN,startHandleDrag);
 
			this.addChild(square4);
			square4.buttonMode=true;
			this.addEventListener(FocusEvent.FOCUS_OUT,hideHandles);
			square4.addEventListener(MouseEvent.MOUSE_DOWN,startHandleDrag);
			
			this.addChild(square5);
			square5.buttonMode=true;
			this.addEventListener(FocusEvent.FOCUS_OUT,hideHandles);
			square5.addEventListener(MouseEvent.MOUSE_DOWN,startHandleDrag);
			
			this.addChild(square6);
			square6.buttonMode=true;
			this.addEventListener(FocusEvent.FOCUS_OUT,hideHandles);
			square6.addEventListener(MouseEvent.MOUSE_DOWN,startHandleDrag);
			
			this.addChild(square7);
			square7.buttonMode=true;
			this.addEventListener(FocusEvent.FOCUS_OUT,hideHandles);
			square7.addEventListener(MouseEvent.MOUSE_DOWN,startHandleDrag);
			
			this.addChild(square8);
			square8.buttonMode=true;
			this.addEventListener(FocusEvent.FOCUS_OUT,hideHandles);
			square8.addEventListener(MouseEvent.MOUSE_DOWN,startHandleDrag);
		}
 
		private function hideHandles(e:FocusEvent):void
		{
			square1.alpha=0;
			square2.alpha=0;
			square3.alpha=0;
			square4.alpha=0;
			square5.alpha=0;
			square6.alpha=0;
			square7.alpha=0;
			square8.alpha=0;
			this.textCustomField.border=false;
			this.addEventListener(MouseEvent.MOUSE_OVER,showHandles);
		}
 
		private function showHandles(e:MouseEvent):void
		{
			square1.alpha=1;
			square2.alpha=1;
			square3.alpha=1;
			square4.alpha=1;
			square5.alpha=1;
			square6.alpha=1;
			square7.alpha=1;
			square8.alpha=1;
			this.textCustomField.border=true;
			textCustomField.borderColor=0x32B5FE;
		}
 
		private function startHandleDrag(e:MouseEvent):void
		{
			handleHolder=e.target;
			origX=mouseX;
			origY=mouseY;
			dragTimer.addEventListener(TimerEvent.TIMER, resizeField);
            dragTimer.start();
		}
 
		private function stopHandleDrag(e:MouseEvent):void
		{
			trace(&quot;stopHandleDrag&quot;);
			removeEventListener(MouseEvent.MOUSE_UP,stopHandleDrag);
			dragTimer.stop();
			dragTimer.reset();
		}
		// resize text field depending on which direction dragging
		private function resizeField(e:TimerEvent):void
		{
			addEventListener(MouseEvent.MOUSE_UP,stopHandleDrag);
			var updatedX:int = mouseX-origX;
			var updatedY:int = mouseY-origY;
			if(handleHolder===square1)
			{
				this.textCustomField.width-=updatedX;
				this.textCustomField.height-=updatedY;
				this.textCustomField.x+=updatedX;
				this.textCustomField.y+=updatedY;
			}
			else if(handleHolder===square2)
			{
				this.textCustomField.width+=updatedX;
				this.textCustomField.height-=updatedY;
				this.textCustomField.y+=updatedY;
			}
			else if(handleHolder===square3)
			{
				this.textCustomField.width-=updatedX;
				this.textCustomField.height+=updatedY;
				this.textCustomField.x+=updatedX;
			}
			else if(handleHolder===square4)
			{
				this.textCustomField.width+=updatedX;
				this.textCustomField.height+=updatedY;
			}
			else if(handleHolder===square5)
			{
				this.textCustomField.height-=updatedY;
				this.textCustomField.y+=updatedY;
			}
			else if(handleHolder===square6)
			{
				this.textCustomField.width+=updatedX;
				//this.textCustomField.y+=updatedY;
			}
			else if(handleHolder===square7)
			{
				this.textCustomField.height+=updatedY;
			}
			else if(handleHolder===square8)
			{
				this.textCustomField.width-=updatedX;
				this.textCustomField.x+=updatedX;				
			}
 
			origX=mouseX;
			origY=mouseY;
			updateHandlePositions();
			e.updateAfterEvent();
		}
		//adjust handles to the new size/position
		private function updateHandlePositions():void
		{
			square1.x=textCustomField.x-square1.width+3;
			square1.y=textCustomField.y-square1.height+3;
			square2.x=textCustomField.x+textCustomField.width-2;
			square2.y=textCustomField.y-square2.width+3;
			square3.x=textCustomField.x-square3.height+3;
			square3.y=textCustomField.height+textCustomField.y-2;
			square4.x=textCustomField.x+textCustomField.width-2;
			square4.y=textCustomField.height+textCustomField.y-2;
			
			//
			square5.x=textCustomField.x-square1.width+(textCustomField.width/2);
			square5.y=textCustomField.y-square1.height+3;
			square6.x=textCustomField.x-square1.width+textCustomField.width+3;
			square6.y=textCustomField.y-square1.height+(textCustomField.height/2);
			square7.x=textCustomField.x-square1.width+(textCustomField.width/2)+3;
			square7.y=textCustomField.y-square1.height+textCustomField.height+3;
			square8.x=textCustomField.x-square1.width+3;
			square8.y=textCustomField.y-square1.height+(textCustomField.height/2);
			
		}
	}
 
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I have made some update to this code still many things need to be fixed to make this work properly</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> resizemc<span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #009900;">//for text format</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextField</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextFormat</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextFormatAlign</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextFieldType</span>;	
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">AntiAliasType</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">FocusEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span>.<span style="color: #004993;">Timer</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">TimerEvent</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> ResizableTextField extends <span style="color: #004993;">Sprite</span> <span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> textCustomField<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span>;
&nbsp;
		<span style="color: #009900;">//handles</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> square1<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> square2<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> square3<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> square4<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> square5<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> square6<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> square7<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> square8<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span>;
&nbsp;
		<span style="color: #009900;">//dragging</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> origX<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> origY<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> dragTimer<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Timer</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Timer</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span>,<span style="color: #000000; font-weight:bold;">10000</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> handleHolder<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> txtClicked<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;
&nbsp;
		<span style="color: #009900;">//text format</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> myFont = <span style="color: #0033ff; font-weight: bold;">new</span> Font1<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> myFormat<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextFormat</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextFormat</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #009900;">// Initialization:</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> CreateTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> ResizableTextField<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">//text format set</span>
			myFormat.<span style="color: #004993;">size</span> = <span style="color: #000000; font-weight:bold;">15</span>;
			myFormat.<span style="color: #004993;">font</span> = myFont.<span style="color: #004993;">fontName</span>;
&nbsp;
			textCustomField = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			textCustomField.<span style="color: #004993;">defaultTextFormat</span> = myFormat;
&nbsp;
			textCustomField.<span style="color: #004993;">embedFonts</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
			textCustomField.<span style="color: #004993;">antiAliasType</span> = <span style="color: #004993;">AntiAliasType</span>.<span style="color: #004993;">ADVANCED</span>;
			textCustomField.<span style="color: #004993;">type</span> = <span style="color: #004993;">TextFieldType</span>.<span style="color: #004993;">INPUT</span>;
			textCustomField.<span style="color: #004993;">multiline</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
			textCustomField.<span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
			textCustomField.<span style="color: #004993;">width</span>=<span style="color: #000000; font-weight:bold;">200</span>;
			textCustomField.<span style="color: #004993;">height</span>=<span style="color: #000000; font-weight:bold;">100</span>;
			textCustomField.<span style="color: #004993;">x</span>=<span style="color: #000000; font-weight:bold;">50</span>;
			textCustomField.<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">50</span>;
			textCustomField.<span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;Type here&quot;</span>;
			textCustomField.<span style="color: #004993;">border</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			textCustomField.<span style="color: #004993;">borderColor</span>=0x32B5FE;
			createHandles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>textCustomField<span style="color: #000000;">&#41;</span>;
			textCustomField.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>,txtClick<span style="color: #000000;">&#41;</span> 
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #009900;">//remove type here text</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> txtClick<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>txtClicked == <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
			event.<span style="color: #004993;">target</span>.<span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;&quot;</span>;
			txtClicked = <span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
&nbsp;
		<span style="color: #009900;">//create 4 draggable handles</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> createHandles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
&nbsp;
			square1 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			square1.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,0x32B5FE<span style="color: #000000;">&#41;</span>;
			square1.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFFFFFF<span style="color: #000000;">&#41;</span>;
			square1.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span>;
			square1.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			square2 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			square2.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,0x32B5FE<span style="color: #000000;">&#41;</span>;
			square2.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFFFFFF<span style="color: #000000;">&#41;</span>;
			square2.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span>;
			square2.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			square3 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			square3.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,0x32B5FE<span style="color: #000000;">&#41;</span>;
			square3.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFFFFFF<span style="color: #000000;">&#41;</span>;
			square3.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span>;
			square3.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			square4 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			square4.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,0x32B5FE<span style="color: #000000;">&#41;</span>;
			square4.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFFFFFF<span style="color: #000000;">&#41;</span>;
			square4.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span>;
			square4.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			square5 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			square5.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,0x32B5FE<span style="color: #000000;">&#41;</span>;
			square5.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFFFFFF<span style="color: #000000;">&#41;</span>;
			square5.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span>;
			square5.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			square6 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			square6.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,0x32B5FE<span style="color: #000000;">&#41;</span>;
			square6.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFFFFFF<span style="color: #000000;">&#41;</span>;
			square6.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span>;
			square6.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			square7 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			square7.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,0x32B5FE<span style="color: #000000;">&#41;</span>;
			square7.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFFFFFF<span style="color: #000000;">&#41;</span>;
			square7.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span>;
			square7.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			square8 = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			square8.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">lineStyle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span>,0x32B5FE<span style="color: #000000;">&#41;</span>;
			square8.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">beginFill</span><span style="color: #000000;">&#40;</span>0xFFFFFF<span style="color: #000000;">&#41;</span>;
			square8.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">drawRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">0</span>,<span style="color: #000000; font-weight:bold;">4</span>,<span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#41;</span>;
			square8.<span style="color: #004993;">graphics</span>.<span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			updateHandlePositions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>square1<span style="color: #000000;">&#41;</span>;
			square1.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">FocusEvent</span>.<span style="color: #004993;">FOCUS_OUT</span>,hideHandles<span style="color: #000000;">&#41;</span>;
			square1.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,startHandleDrag<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>square2<span style="color: #000000;">&#41;</span>;
			square2.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">FocusEvent</span>.<span style="color: #004993;">FOCUS_OUT</span>,hideHandles<span style="color: #000000;">&#41;</span>;
			square2.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,startHandleDrag<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>square3<span style="color: #000000;">&#41;</span>;
			square3.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">FocusEvent</span>.<span style="color: #004993;">FOCUS_OUT</span>,hideHandles<span style="color: #000000;">&#41;</span>;
			square3.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,startHandleDrag<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>square4<span style="color: #000000;">&#41;</span>;
			square4.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">FocusEvent</span>.<span style="color: #004993;">FOCUS_OUT</span>,hideHandles<span style="color: #000000;">&#41;</span>;
			square4.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,startHandleDrag<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>square5<span style="color: #000000;">&#41;</span>;
			square5.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">FocusEvent</span>.<span style="color: #004993;">FOCUS_OUT</span>,hideHandles<span style="color: #000000;">&#41;</span>;
			square5.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,startHandleDrag<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>square6<span style="color: #000000;">&#41;</span>;
			square6.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">FocusEvent</span>.<span style="color: #004993;">FOCUS_OUT</span>,hideHandles<span style="color: #000000;">&#41;</span>;
			square6.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,startHandleDrag<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>square7<span style="color: #000000;">&#41;</span>;
			square7.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">FocusEvent</span>.<span style="color: #004993;">FOCUS_OUT</span>,hideHandles<span style="color: #000000;">&#41;</span>;
			square7.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,startHandleDrag<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>square8<span style="color: #000000;">&#41;</span>;
			square8.<span style="color: #004993;">buttonMode</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">FocusEvent</span>.<span style="color: #004993;">FOCUS_OUT</span>,hideHandles<span style="color: #000000;">&#41;</span>;
			square8.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,startHandleDrag<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> hideHandles<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">FocusEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			square1.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0</span>;
			square2.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0</span>;
			square3.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0</span>;
			square4.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0</span>;
			square5.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0</span>;
			square6.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0</span>;
			square7.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0</span>;
			square8.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">border</span>=<span style="color: #0033ff; font-weight: bold;">false</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_OVER</span>,showHandles<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> showHandles<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			square1.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			square2.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			square3.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			square4.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			square5.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			square6.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			square7.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			square8.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">border</span>=<span style="color: #0033ff; font-weight: bold;">true</span>;
			textCustomField.<span style="color: #004993;">borderColor</span>=0x32B5FE;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> startHandleDrag<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			handleHolder=e.<span style="color: #004993;">target</span>;
			origX=<span style="color: #004993;">mouseX</span>;
			origY=<span style="color: #004993;">mouseY</span>;
			dragTimer.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">TimerEvent</span>.<span style="color: #004993;">TIMER</span>, resizeField<span style="color: #000000;">&#41;</span>;
            dragTimer.<span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> stopHandleDrag<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;stopHandleDrag&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_UP</span>,stopHandleDrag<span style="color: #000000;">&#41;</span>;
			dragTimer.<span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			dragTimer.<span style="color: #004993;">reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">// resize text field depending on which direction dragging</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> resizeField<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TimerEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_UP</span>,stopHandleDrag<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> updatedX<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = mouseX<span style="color: #000000; font-weight: bold;">-</span>origX;
			<span style="color: #6699cc; font-weight: bold;">var</span> updatedY<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span> = mouseY<span style="color: #000000; font-weight: bold;">-</span>origY;
			<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>handleHolder===square1<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.width<span style="color: #000000; font-weight: bold;">-</span>=updatedX;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.height<span style="color: #000000; font-weight: bold;">-</span>=updatedY;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">+</span>=updatedX;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">y</span><span style="color: #000000; font-weight: bold;">+</span>=updatedY;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>handleHolder===square2<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span>=updatedX;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.height<span style="color: #000000; font-weight: bold;">-</span>=updatedY;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">y</span><span style="color: #000000; font-weight: bold;">+</span>=updatedY;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>handleHolder===square3<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.width<span style="color: #000000; font-weight: bold;">-</span>=updatedX;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span>=updatedY;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">+</span>=updatedX;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>handleHolder===square4<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span>=updatedX;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span>=updatedY;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>handleHolder===square5<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.height<span style="color: #000000; font-weight: bold;">-</span>=updatedY;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">y</span><span style="color: #000000; font-weight: bold;">+</span>=updatedY;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>handleHolder===square6<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span>=updatedX;
				<span style="color: #009900;">//this.textCustomField.y+=updatedY;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>handleHolder===square7<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span>=updatedY;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>handleHolder===square8<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.width<span style="color: #000000; font-weight: bold;">-</span>=updatedX;
				<span style="color: #0033ff; font-weight: bold;">this</span>.textCustomField.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">+</span>=updatedX;				
			<span style="color: #000000;">&#125;</span>
&nbsp;
			origX=<span style="color: #004993;">mouseX</span>;
			origY=<span style="color: #004993;">mouseY</span>;
			updateHandlePositions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			e.<span style="color: #004993;">updateAfterEvent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">//adjust handles to the new size/position</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> updateHandlePositions<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			square1.<span style="color: #004993;">x</span>=textCustomField.x<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square1.<span style="color: #004993;">y</span>=textCustomField.y<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square2.<span style="color: #004993;">x</span>=textCustomField.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">+</span>textCustomField.width<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">2</span>;
			square2.<span style="color: #004993;">y</span>=textCustomField.y<span style="color: #000000; font-weight: bold;">-</span>square2.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square3.<span style="color: #004993;">x</span>=textCustomField.x<span style="color: #000000; font-weight: bold;">-</span>square3.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square3.<span style="color: #004993;">y</span>=textCustomField.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span>textCustomField.y<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">2</span>;
			square4.<span style="color: #004993;">x</span>=textCustomField.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">+</span>textCustomField.width<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">2</span>;
			square4.<span style="color: #004993;">y</span>=textCustomField.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span>textCustomField.y<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">2</span>;
&nbsp;
			<span style="color: #009900;">//</span>
			square5.<span style="color: #004993;">x</span>=textCustomField.x<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>textCustomField.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span>;
			square5.<span style="color: #004993;">y</span>=textCustomField.y<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square6.<span style="color: #004993;">x</span>=textCustomField.x<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span>textCustomField.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square6.<span style="color: #004993;">y</span>=textCustomField.y<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>textCustomField.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span>;
			square7.<span style="color: #004993;">x</span>=textCustomField.x<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>textCustomField.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square7.<span style="color: #004993;">y</span>=textCustomField.y<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span>textCustomField.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square8.<span style="color: #004993;">x</span>=textCustomField.x<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">width</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">3</span>;
			square8.<span style="color: #004993;">y</span>=textCustomField.y<span style="color: #000000; font-weight: bold;">-</span>square1.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span>textCustomField.<span style="color: #004993;">height</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: moonpixel</title>
		<link>http://moonpixel.com/resize-text-field-as3-draggable-resizable-input-text-field/comment-page-1/#comment-380</link>
		<dc:creator>moonpixel</dc:creator>
		<pubDate>Thu, 03 Jun 2010 05:17:13 +0000</pubDate>
		<guid isPermaLink="false">http://moonpixel.com/?p=72#comment-380</guid>
		<description>could be that you&#039;re pasting the code into a keyframe on the timeline?
it that&#039;s the case then you need to save it externally into an .as file</description>
		<content:encoded><![CDATA[<p>could be that you&#8217;re pasting the code into a keyframe on the timeline?<br />
it that&#8217;s the case then you need to save it externally into an .as file</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brad</title>
		<link>http://moonpixel.com/resize-text-field-as3-draggable-resizable-input-text-field/comment-page-1/#comment-372</link>
		<dc:creator>brad</dc:creator>
		<pubDate>Wed, 02 Jun 2010 20:32:35 +0000</pubDate>
		<guid isPermaLink="false">http://moonpixel.com/?p=72#comment-372</guid>
		<description>1037: Packages cannot be nested.

thats the error I get.

anyone help?</description>
		<content:encoded><![CDATA[<p>1037: Packages cannot be nested.</p>
<p>thats the error I get.</p>
<p>anyone help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ikke</title>
		<link>http://moonpixel.com/resize-text-field-as3-draggable-resizable-input-text-field/comment-page-1/#comment-76</link>
		<dc:creator>Ikke</dc:creator>
		<pubDate>Thu, 11 Mar 2010 09:04:44 +0000</pubDate>
		<guid isPermaLink="false">http://moonpixel.com/?p=72#comment-76</guid>
		<description>nice class but add this at the appropriate spots,
it´s a beauty detail but still, 
it will make the text &quot;type here&quot; dissapear the moment you start typing (click the textfield),

i don´t have a compiler here so i didn´t test but i think it´s without writing mistakes,



private var txtClicked:Boolean = false;

//add this to the bottom of public function ResizableTextField()
//{
	textCustomField.addEventListener(MouseEvent.CLICK,txtClick)
//}
		
private function txtClick(event:MouseEvent):void
{
	if(txtClicked == false)
	{
		event.target.text = &quot;&quot;;
		txtClicked = true;
	}
}</description>
		<content:encoded><![CDATA[<p>nice class but add this at the appropriate spots,<br />
it´s a beauty detail but still,<br />
it will make the text &#8220;type here&#8221; dissapear the moment you start typing (click the textfield),</p>
<p>i don´t have a compiler here so i didn´t test but i think it´s without writing mistakes,</p>
<p>private var txtClicked:Boolean = false;</p>
<p>//add this to the bottom of public function ResizableTextField()<br />
//{<br />
	textCustomField.addEventListener(MouseEvent.CLICK,txtClick)<br />
//}</p>
<p>private function txtClick(event:MouseEvent):void<br />
{<br />
	if(txtClicked == false)<br />
	{<br />
		event.target.text = &#8220;&#8221;;<br />
		txtClicked = true;<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://moonpixel.com/resize-text-field-as3-draggable-resizable-input-text-field/comment-page-1/#comment-29</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sat, 13 Feb 2010 04:31:41 +0000</pubDate>
		<guid isPermaLink="false">http://moonpixel.com/?p=72#comment-29</guid>
		<description>Hey thanks for sharing, it looks very clean and its a great start to reference from :)</description>
		<content:encoded><![CDATA[<p>Hey thanks for sharing, it looks very clean and its a great start to reference from <img src='http://moonpixel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
