<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>cairngorm/src/com/insideria/twitteria/view/status/StatusText.mxml</filename>
    </added>
    <added>
      <filename>puremvc/src/com/insideria/twitteria/view/components/status/StatusText.mxml</filename>
    </added>
    <added>
      <filename>raw_and_uncut/src/StatusText.mxml</filename>
    </added>
    <added>
      <filename>swiz/src/com/insideria/twitteria/view/status/StatusText.mxml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-&lt;mx:VBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; creationComplete=&quot;init()&quot;&gt;
+&lt;mx:VBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; creationComplete=&quot;init()&quot; xmlns:status=&quot;com.insideria.twitteria.view.status.*&quot;&gt;
 	&lt;mx:Script&gt;
 	&lt;![CDATA[
 		import com.insideria.twitteria.event.SetStatusEvent;
@@ -11,9 +11,6 @@
 		[Bindable]
 		private var model:TwitteRIAModel = TwitteRIAModel.getInstance();
 		
-		[Bindable]
-		private var charactersLeft:int = 140;
-
 		private function init():void {
 			reload();
 		}
@@ -24,18 +21,7 @@
 		
 		private function setStatus():void {
 			new SetStatusEvent(statusText.text).dispatch();
-			statusText.text = '';
-			countCharactersLeft();
-		}
-		
-		private function countCharactersLeft():void {
-			var chars:int = 140 - statusText.text.length;
-			charactersLeft = Math.max(chars, 0);
-			if (charactersLeft &gt; 10) {
-				charactersLeftLabel.setStyle(&quot;color&quot;, 0xEEEEEE);
-			} else {
-				charactersLeftLabel.setStyle(&quot;color&quot;, 0xFF5555);
-			}
+			statusText.clear();
 		}
 		
 	]]&gt;
@@ -52,8 +38,14 @@
 	&lt;mx:HBox width=&quot;100%&quot; styleName=&quot;instructions&quot;&gt;
 		&lt;mx:Label text=&quot;What are you doing?&quot; /&gt;
 		&lt;mx:Spacer width=&quot;100%&quot; /&gt;
-		&lt;mx:Label id=&quot;charactersLeftLabel&quot; text=&quot;{charactersLeft}&quot; styleName=&quot;charactersLeft&quot; /&gt;
+		&lt;mx:Label id=&quot;charactersLeftLabel&quot; text=&quot;{statusText.charactersLeft}&quot; styleName=&quot;charactersLeft&quot; /&gt;
 	&lt;/mx:HBox&gt;
-	&lt;mx:TextInput id=&quot;statusText&quot; enter=&quot;setStatus()&quot; width=&quot;100%&quot; maxChars=&quot;140&quot; keyUp=&quot;countCharactersLeft()&quot; /&gt;
+	&lt;status:StatusText
+		id=&quot;statusText&quot;
+		width=&quot;100%&quot;
+		status=&quot;setStatus()&quot;
+		limitWarning=&quot;charactersLeftLabel.setStyle('color', 0xFF5555)&quot;
+		underLimit=&quot;charactersLeftLabel.setStyle('color', 0xEEEEEE)&quot;
+	/&gt;
 	
 &lt;/mx:VBox&gt;</diff>
      <filename>cairngorm/src/com/insideria/twitteria/view/MainView.mxml</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-&lt;mx:VBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
+&lt;mx:VBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; xmlns:status=&quot;com.insideria.twitteria.view.components.status.*&quot;&gt;
 
 	&lt;mx:Metadata&gt;
 		[Event(name=&quot;setStatus&quot;, type=&quot;flash.events.Event&quot;)]
@@ -12,25 +12,11 @@
 		public static const SET_STATUS:String = 'setStatus';
 
 		[Bindable]
-		private var charactersLeft:int = 140;
-		
-		[Bindable]
 		public var currentTweets:ArrayCollection; // &lt;TwitterStatus&gt;
 
 		private function setStatus():void {
 			dispatchEvent(new Event(SET_STATUS));
-			statusText.text = '';
-			countCharactersLeft();
-		}
-		
-		private function countCharactersLeft():void {
-			var chars:int = 140 - statusText.text.length;
-			charactersLeft = Math.max(chars, 0);
-			if (charactersLeft &gt; 10) {
-				charactersLeftLabel.setStyle(&quot;color&quot;, 0xEEEEEE);
-			} else {
-				charactersLeftLabel.setStyle(&quot;color&quot;, 0xFF5555);
-			}
+			statusText.clear();
 		}
 		
 	]]&gt;
@@ -47,8 +33,14 @@
 	&lt;mx:HBox width=&quot;100%&quot; styleName=&quot;instructions&quot;&gt;
 		&lt;mx:Label text=&quot;What are you doing?&quot; /&gt;
 		&lt;mx:Spacer width=&quot;100%&quot; /&gt;
-		&lt;mx:Label id=&quot;charactersLeftLabel&quot; text=&quot;{charactersLeft}&quot; styleName=&quot;charactersLeft&quot; /&gt;
+		&lt;mx:Label id=&quot;charactersLeftLabel&quot; text=&quot;{statusText.charactersLeft}&quot; styleName=&quot;charactersLeft&quot; /&gt;
 	&lt;/mx:HBox&gt;
-	&lt;mx:TextInput id=&quot;statusText&quot; enter=&quot;setStatus()&quot; width=&quot;100%&quot; maxChars=&quot;140&quot; keyUp=&quot;countCharactersLeft()&quot; /&gt;
+	&lt;status:StatusText
+		id=&quot;statusText&quot;
+		width=&quot;100%&quot;
+		status=&quot;setStatus()&quot;
+		limitWarning=&quot;charactersLeftLabel.setStyle('color', 0xFF5555)&quot;
+		underLimit=&quot;charactersLeftLabel.setStyle('color', 0xEEEEEE)&quot;
+	/&gt;
 	
 &lt;/mx:VBox&gt;</diff>
      <filename>puremvc/src/com/insideria/twitteria/view/components/MainView.mxml</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-&lt;mx:VBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; creationComplete=&quot;init()&quot;&gt;
+&lt;mx:VBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; creationComplete=&quot;init()&quot; xmlns:local=&quot;*&quot;&gt;
 	&lt;mx:Script&gt;
 	&lt;![CDATA[
 		import twitter.api.data.TwitterStatus;
@@ -14,9 +14,6 @@
 		[Bindable]
 		public var currentTweets:ArrayCollection; // &lt;TwitterStatus&gt;
 		
-		[Bindable]
-		private var charactersLeft:int = 140;
-
 		private var twitterService:Twitter;
 		private var useDummyData:Boolean = true;
 		
@@ -49,21 +46,10 @@
 		}
 		
 		private function statusSet(te:TwitterEvent):void {
-			statusText.text = '';
-			countCharactersLeft();
+			statusText.clear();
 			reload();
 		}
 		
-		private function countCharactersLeft():void {
-			var chars:int = 140 - statusText.text.length;
-			charactersLeft = Math.max(chars, 0);
-			if (charactersLeft &gt; 10) {
-				charactersLeftLabel.setStyle(&quot;color&quot;, 0xEEEEEE);
-			} else {
-				charactersLeftLabel.setStyle(&quot;color&quot;, 0xFF5555);
-			}
-		}
-		
 		private function getDummyData():Array {
 			var i:int;
 			var statusObj:Object;
@@ -91,8 +77,14 @@
 	&lt;mx:HBox width=&quot;100%&quot; styleName=&quot;instructions&quot;&gt;
 		&lt;mx:Label text=&quot;What are you doing?&quot; /&gt;
 		&lt;mx:Spacer width=&quot;100%&quot; /&gt;
-		&lt;mx:Label id=&quot;charactersLeftLabel&quot; text=&quot;{charactersLeft}&quot; styleName=&quot;charactersLeft&quot; /&gt;
+		&lt;mx:Label id=&quot;charactersLeftLabel&quot; text=&quot;{statusText.charactersLeft}&quot; styleName=&quot;charactersLeft&quot; /&gt;
 	&lt;/mx:HBox&gt;
-	&lt;mx:TextInput id=&quot;statusText&quot; enter=&quot;setStatus()&quot; width=&quot;100%&quot; maxChars=&quot;140&quot; keyUp=&quot;countCharactersLeft()&quot; /&gt;
+	&lt;local:StatusText
+		id=&quot;statusText&quot;
+		width=&quot;100%&quot;
+		status=&quot;setStatus()&quot;
+		limitWarning=&quot;charactersLeftLabel.setStyle('color', 0xFF5555)&quot;
+		underLimit=&quot;charactersLeftLabel.setStyle('color', 0xEEEEEE)&quot;
+	/&gt;
 	
 &lt;/mx:VBox&gt;</diff>
      <filename>raw_and_uncut/src/MainView.mxml</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,5 @@
 &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
-&lt;mx:VBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
+&lt;mx:VBox xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; width=&quot;100%&quot; height=&quot;100%&quot; xmlns:status=&quot;com.insideria.twitteria.view.status.*&quot;&gt;
 	&lt;mx:Script&gt;
 	&lt;![CDATA[
 		import com.insideria.twitteria.controllers.MainViewController;
@@ -10,23 +10,9 @@
 		[Autowire(bean=&quot;mainViewController&quot;)]
 		public var controller:MainViewController;
 		
-		[Bindable]
-		private var charactersLeft:int = 140;
-
 		private function setStatus():void {
-			controller.setStatus(statusText.text);
-			statusText.text = '';
-			countCharactersLeft();
-		}
-		
-		private function countCharactersLeft():void {
-			var chars:int = 140 - statusText.text.length;
-			charactersLeft = Math.max(chars, 0);
-			if (charactersLeft &gt; 10) {
-				charactersLeftLabel.setStyle(&quot;color&quot;, 0xEEEEEE);
-			} else {
-				charactersLeftLabel.setStyle(&quot;color&quot;, 0xFF5555);
-			}
+			controller.setStatus(statusText.text); 
+			statusText.clear();
 		}
 		
 	]]&gt;
@@ -43,8 +29,14 @@
 	&lt;mx:HBox width=&quot;100%&quot; styleName=&quot;instructions&quot;&gt;
 		&lt;mx:Label text=&quot;What are you doing?&quot; /&gt;
 		&lt;mx:Spacer width=&quot;100%&quot; /&gt;
-		&lt;mx:Label id=&quot;charactersLeftLabel&quot; text=&quot;{charactersLeft}&quot; styleName=&quot;charactersLeft&quot; /&gt;
+		&lt;mx:Label id=&quot;charactersLeftLabel&quot; text=&quot;{statusText.charactersLeft}&quot; styleName=&quot;charactersLeft&quot; /&gt;
 	&lt;/mx:HBox&gt;
-	&lt;mx:TextInput id=&quot;statusText&quot; enter=&quot;setStatus()&quot; width=&quot;100%&quot; maxChars=&quot;140&quot; keyUp=&quot;countCharactersLeft()&quot; /&gt;
+	&lt;status:StatusText
+		id=&quot;statusText&quot;
+		width=&quot;100%&quot;
+		status=&quot;setStatus()&quot;
+		limitWarning=&quot;charactersLeftLabel.setStyle('color', 0xFF5555)&quot;
+		underLimit=&quot;charactersLeftLabel.setStyle('color', 0xEEEEEE)&quot;
+	/&gt;
 	
 &lt;/mx:VBox&gt;</diff>
      <filename>swiz/src/com/insideria/twitteria/view/MainView.mxml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c4bef47761cbbd61db312cbc47313e62fd057073</id>
    </parent>
  </parents>
  <author>
    <name>Tony Hillerson</name>
    <email>tony.hillerson@effectiveui.com</email>
  </author>
  <url>http://github.com/thillerson/twitteria/commit/5e4a5af82ed2c6a04c87cbd5bcec751a3f499698</url>
  <id>5e4a5af82ed2c6a04c87cbd5bcec751a3f499698</id>
  <committed-date>2008-10-06T21:09:45-07:00</committed-date>
  <authored-date>2008-10-06T21:09:45-07:00</authored-date>
  <message>a cleaner implementation of the status text. cleaner main view, more encapsulation</message>
  <tree>8d6640c72c345458d4c803f7cc6616511f184abf</tree>
  <committer>
    <name>Tony Hillerson</name>
    <email>tony.hillerson@effectiveui.com</email>
  </committer>
</commit>
