flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] - Added sample using CreateJS. Using the createjs namespace and corresponding SDK, you can target the JavaScript version to use CreateJS for the 'components'. This example includes only a label and a button, but it lays the founda
Date Wed, 24 Apr 2013 20:11:59 GMT
Updated Branches:
  refs/heads/develop ab3a320ba -> 947a1785a


Added sample using CreateJS. Using the createjs namespace and corresponding SDK, you can target
the JavaScript version to use CreateJS for the 'components'. This example includes only a
label and a button, but it lays the foundation for more components.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/947a1785
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/947a1785
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/947a1785

Branch: refs/heads/develop
Commit: 947a1785a9a0f8c77e398cf4e9d8538c58585e6b
Parents: ab3a320
Author: Peter Ent <pent@apache.org>
Authored: Wed Apr 24 16:11:44 2013 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Wed Apr 24 16:11:44 2013 -0400

----------------------------------------------------------------------
 .../FlexJSTest_createjs/src/CreateJSExample.mxml   |   58 ++++++
 .../FlexJSTest_createjs/src/MyInitialView.mxml     |   55 ++++++
 .../src/controllers/MyController.as                |   57 ++++++
 examples/FlexJSTest_createjs/src/models/MyModel.as |   53 +++++
 frameworks/as/compile-config.xml                   |    5 +
 frameworks/as/createjs-manifest.xml                |   30 +++
 frameworks/as/defaults.css                         |    7 +
 .../as/src/org/apache/flex/createjs/Application.as |  137 +++++++++++++
 .../as/src/org/apache/flex/createjs/core/UIBase.as |  151 +++++++++++++++
 .../src/org/apache/flex/createjs/core/ViewBase.as  |   60 ++++++
 .../apache/flex/createjs/staticControls/Label.as   |   27 +++
 .../flex/createjs/staticControls/TextButton.as     |   68 +++++++
 .../src/org/apache/flex/createjs/Application.js    |  147 ++++++++++++++
 .../src/org/apache/flex/createjs/core/UIBase.js    |  146 ++++++++++++++
 .../src/org/apache/flex/createjs/core/ViewBase.js  |   66 +++++++
 .../apache/flex/createjs/staticControls/Label.js   |   65 ++++++
 .../flex/createjs/staticControls/TextButton.js     |   79 ++++++++
 17 files changed, 1211 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/examples/FlexJSTest_createjs/src/CreateJSExample.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSTest_createjs/src/CreateJSExample.mxml b/examples/FlexJSTest_createjs/src/CreateJSExample.mxml
new file mode 100644
index 0000000..9f4bbf6
--- /dev/null
+++ b/examples/FlexJSTest_createjs/src/CreateJSExample.mxml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!---
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+-->
+<createjs:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+					  xmlns:local="*"
+					  xmlns:basic="library://ns.apache.org/flexjs/basic"   
+					  xmlns:createjs="library://ns.apache.org/flexjs/createjs"
+					  xmlns:models="models.*" 
+					  xmlns:controllers="controllers.*"
+					  initialize="MyModel(model).labelText='Hello World'"
+					  >
+	
+	<!--
+	This example shows how to use CreateJS for the web framework. While the example
+	shows only a label and button, you can extend the pattern to include other
+	controls.
+	
+	Once you have compiled the application into JavaScript using Falcon JX, you
+	must do two more things to make the example work:
+	
+	1. Copy the CreateJS easeljs JavaScript library into the js-debug or js-release directory
+	so it available when the application is opened by the browser.
+	
+	2. Modify the index.html file that the compile created so that includes the CreateJS
+	easeljs library. For example: <script src="./lib/easeljs-0.6.0.min.js"></script>
+	-->
+	
+	<createjs:valuesImpl>
+		<basic:SimpleCSSValuesImpl />
+	</createjs:valuesImpl>
+	<createjs:initialView>
+		<local:MyInitialView />
+	</createjs:initialView>
+	<createjs:model>
+		<models:MyModel />
+	</createjs:model>
+	<createjs:controller>
+		<controllers:MyController />
+	</createjs:controller>
+	
+</createjs:Application>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/examples/FlexJSTest_createjs/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSTest_createjs/src/MyInitialView.mxml b/examples/FlexJSTest_createjs/src/MyInitialView.mxml
new file mode 100644
index 0000000..2e7a9b2
--- /dev/null
+++ b/examples/FlexJSTest_createjs/src/MyInitialView.mxml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<createjs:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+				xmlns:basic="library://ns.apache.org/flexjs/basic" 
+				xmlns:createjs="library://ns.apache.org/flexjs/createjs"
+				>
+	<fx:Script>
+		<![CDATA[   
+			
+			import org.apache.flex.events.Event;
+			
+			public function simpleClick() : void
+			{
+				lbl1.text = "pushed";
+			}
+			
+			public function changeLabel() : void
+			{
+				dispatchEvent( new org.apache.flex.events.Event("pushme2Clicked") );
+				
+			}
+		]]>
+	</fx:Script>
+	
+	<createjs:Label id="lbl1" x="50" y="100" text="push me changes me" />
+	<createjs:TextButton x="50" y="225" text="Push Me" click="simpleClick()" />
+	
+	<createjs:Label id="lbl2" x="350" y="100">
+		<createjs:beads>
+			<basic:SimpleBinding eventName="labelTextChanged"
+								 sourceID="applicationModel"
+								 sourcePropertyName="labelText"
+								 destinationPropertyName="text" />
+		</createjs:beads>
+	</createjs:Label>
+	<createjs:TextButton x="350" y="225" text="Change Label" click="changeLabel()" />
+
+</createjs:ViewBase>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/examples/FlexJSTest_createjs/src/controllers/MyController.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSTest_createjs/src/controllers/MyController.as b/examples/FlexJSTest_createjs/src/controllers/MyController.as
new file mode 100644
index 0000000..666a249
--- /dev/null
+++ b/examples/FlexJSTest_createjs/src/controllers/MyController.as
@@ -0,0 +1,57 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package controllers
+{	
+	import models.MyModel;
+	
+	import org.apache.flex.core.Application;
+	import org.apache.flex.core.IDocument;
+	import org.apache.flex.events.Event;
+    	
+	public class MyController implements IDocument
+	{
+		public function MyController(app:Application = null)
+		{
+			if (app)
+			{
+				this.app = app as CreateJSExample;
+				app.addEventListener("viewChanged", viewChangeHandler);
+			}
+		}
+		
+		private var app:CreateJSExample;
+		
+		private function viewChangeHandler(event:Event):void
+		{
+			app.initialView.addEventListener("pushme2Clicked", pushme2ClickHandler);
+		}
+		
+		private function pushme2ClickHandler(event:Event):void
+		{
+			MyModel(app.model).labelText = "push me again";
+		}
+        
+		public function setDocument(document:Object, id:String = null):void
+		{
+			this.app = document as CreateJSExample;
+			app.addEventListener("viewChanged", viewChangeHandler);
+		}
+
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/examples/FlexJSTest_createjs/src/models/MyModel.as
----------------------------------------------------------------------
diff --git a/examples/FlexJSTest_createjs/src/models/MyModel.as b/examples/FlexJSTest_createjs/src/models/MyModel.as
new file mode 100644
index 0000000..f79667b
--- /dev/null
+++ b/examples/FlexJSTest_createjs/src/models/MyModel.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package models
+{
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.EventDispatcher;
+	
+	public class MyModel extends EventDispatcher
+	{
+		public function MyModel()
+		{
+		}
+		
+		private var _labelText:String;
+		
+		public function get labelText():String
+		{
+			return _labelText;
+		}
+		
+		public function set labelText(value:String):void
+		{
+			if (value != _labelText)
+			{
+				_labelText = value;
+				dispatchEvent(new Event("labelTextChanged"));
+			}
+		}
+		
+		private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
+		public function get strings():Array
+		{
+			return _strings;
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/as/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/compile-config.xml b/frameworks/as/compile-config.xml
index 4bc76b2..f96ddcf 100644
--- a/frameworks/as/compile-config.xml
+++ b/frameworks/as/compile-config.xml
@@ -42,6 +42,10 @@
                 <uri>library://ns.apache.org/flexjs/jquery</uri>
                 <manifest>jquery-manifest.xml</manifest>
             </namespace>
+            <namespace>
+                <uri>library://ns.apache.org/flexjs/createjs</uri>
+                <manifest>createjs-manifest.xml</manifest>
+            </namespace>
         </namespaces>
         
         <source-path>
@@ -64,6 +68,7 @@
         <uri>library://ns.apache.org/flexjs/basic</uri>
         <uri>library://ns.apache.org/flexjs/html5</uri>
         <uri>library://ns.apache.org/flexjs/jquery</uri>
+        <uri>library://ns.apache.org/flexjs/createjs</uri>
     </include-namespaces>  
         
     <target-player>${playerglobal.version}</target-player>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/as/createjs-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/createjs-manifest.xml b/frameworks/as/createjs-manifest.xml
new file mode 100644
index 0000000..f856cdf
--- /dev/null
+++ b/frameworks/as/createjs-manifest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+
+<componentPackage>
+
+    <component id="Application" class="org.apache.flex.createjs.Application"/>
+    <component id="UIBase" class="org.apache.flex.createjs.core.UIBase"/>
+    <component id="ViewBase" class="org.apache.flex.createjs.core.ViewBase"/>
+    <component id="Label" class="org.apache.flex.createjs.staticControls.Label"/>
+    <component id="TextButton" class="org.apache.flex.createjs.staticControls.TextButton"/>
+
+</componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/defaults.css b/frameworks/as/defaults.css
index 2263e9f..4571f7b 100644
--- a/frameworks/as/defaults.css
+++ b/frameworks/as/defaults.css
@@ -20,6 +20,7 @@
 @namespace "library://ns.apache.org/flexjs/basic";
 @namespace h5 "library://ns.apache.org/flexjs/html5";
 @namespace jq "library://ns.apache.org/flexjs/jquery";
+@namespace createjs "library://ns.apache.org/flexjs/createjs";
 
 /* Global style declaration */
 *
@@ -167,4 +168,10 @@ jq|RadioButton
     IRadioButtonBead:  ClassReference("org.apache.flex.html.staticControls.beads.RadioButtonBead");
		
 }
 
+/* createjs */
+
+createjs|TextButton
+{
+        ITextButtonBead: ClassReference("org.apache.flex.html.staticControls.beads.TextButtonBead");
 }
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/as/src/org/apache/flex/createjs/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/createjs/Application.as b/frameworks/as/src/org/apache/flex/createjs/Application.as
new file mode 100644
index 0000000..99f690d
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/createjs/Application.as
@@ -0,0 +1,137 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.createjs
+{
+	import flash.display.Sprite;
+	import flash.display.StageAlign;
+	import flash.display.StageScaleMode;
+	
+	// this import is not used, but keeps the compiler from
+	// complaining about explicit usage of flash.events.Event
+	import flash.events.IOErrorEvent;
+	
+//	import org.apache.flex.core.Application;
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.IFlexInfo;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IValuesImpl;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.createjs.core.ViewBase;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.utils.MXMLDataInterpreter;
+	
+	//--------------------------------------
+	//  Events
+	//--------------------------------------
+	
+	/**
+	 *  Dispatched at startup.
+	 */
+	[Event(name="initialize", type="org.apache.flex.events.Event")]
+	
+	public class Application extends Sprite implements IStrand, IFlexInfo
+	{
+		public function Application()
+		{
+			super();
+			if (stage)
+			{
+				stage.align = StageAlign.TOP_LEFT;
+				stage.scaleMode = StageScaleMode.NO_SCALE;
+			}
+			
+			loaderInfo.addEventListener(flash.events.Event.INIT, initHandler);
+		}
+		
+		private function initHandler(event:Event):void
+		{
+			MXMLDataInterpreter.generateMXMLProperties(this, MXMLProperties);
+			
+			ValuesManager.valuesImpl = valuesImpl;
+			ValuesManager.valuesImpl.init(this);
+			
+			dispatchEvent(new Event("initialize"));
+			
+			initialView.addToParent(this);
+			initialView.initUI(model);
+			dispatchEvent(new Event("viewChanged"));
+		}
+		
+		public var valuesImpl:IValuesImpl;
+		
+		public var initialView:ViewBase;
+		
+		public var model:Object;
+		
+		public var controller:Object;
+		
+		public function get MXMLDescriptor():Array
+		{
+			return null;
+		}
+		
+		public function get MXMLProperties():Array
+		{
+			return null;
+		}
+		
+		// beads declared in MXML are added to the strand.
+		// from AS, just call addBead()
+		public var beads:Array;
+		
+		private var _beads:Vector.<IBead>;
+		public function addBead(bead:IBead):void
+		{
+			if (!_beads)
+				_beads = new Vector.<IBead>;
+			_beads.push(bead);
+			bead.strand = this;
+		}
+		
+		public function getBeadByType(classOrInterface:Class):IBead
+		{
+			for each (var bead:IBead in _beads)
+			{
+				if (bead is classOrInterface)
+					return bead;
+			}
+			return null;
+		}
+		
+		public function removeBead(value:IBead):IBead	
+		{
+			var n:int = _beads.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				var bead:IBead = _beads[i];
+				if (bead == value)
+				{
+					_beads.splice(i, 1);
+					return bead;
+				}
+			}
+			return null;
+		}
+		
+		public function get info():Object
+		{
+			return {};           
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/as/src/org/apache/flex/createjs/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/createjs/core/UIBase.as b/frameworks/as/src/org/apache/flex/createjs/core/UIBase.as
new file mode 100644
index 0000000..c76d864
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/createjs/core/UIBase.as
@@ -0,0 +1,151 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.createjs.core
+{
+	import flash.display.DisplayObjectContainer;
+	import flash.display.Sprite;
+	import org.apache.flex.core.IInitModel;
+	import org.apache.flex.core.IStrand;
+	import org.apache.flex.core.IBeadModel;
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.events.Event;
+	import org.apache.flex.events.IEventDispatcher;
+	
+	public class UIBase extends Sprite implements IInitModel, IStrand, IEventDispatcher
+	{
+		public function UIBase()
+		{
+			super();
+		}
+		
+		private var _width:Number = 0;
+		override public function get width():Number
+		{
+			return _width;
+		}
+		override public function set width(value:Number):void
+		{
+			if (_width != value)
+			{
+				_width = value;
+				dispatchEvent(new Event("widthChanged"));
+			}
+		}
+		protected function get $width():Number
+		{
+			return super.width;
+		}
+		
+		private var _height:Number = 0;
+		override public function get height():Number
+		{
+			return _height;
+		}
+		override public function set height(value:Number):void
+		{
+			if (_height != value)
+			{
+				_height = value;
+				dispatchEvent(new Event("heightChanged"));
+			}
+		}
+		protected function get $height():Number
+		{
+			return super.height;
+		}
+		
+		private var _model:IBeadModel;
+		public function get model():IBeadModel
+		{
+			return _model;
+		}
+		public function set model(value:IBeadModel):void
+		{
+			if (_model != value)
+			{
+				addBead(value as IBead);
+				dispatchEvent(new Event("modelChanged"));
+			}
+		}
+		
+		private var _id:String;
+		public function get id():String
+		{
+			return _id;
+		}
+		public function set id(value:String):void
+		{
+			if (_id != value)
+			{
+				_id = value;
+				dispatchEvent(new Event("idChanged"));
+			}
+		}
+		
+		// beads declared in MXML are added to the strand.
+		// from AS, just call addBead()
+		public var beads:Array;
+		
+		private var _beads:Vector.<IBead>;
+		public function addBead(bead:IBead):void
+		{
+			if (!_beads)
+				_beads = new Vector.<IBead>;
+			_beads.push(bead);
+			if (bead is IBeadModel)
+				_model = bead as IBeadModel;
+			bead.strand = this;
+		}
+		
+		public function getBeadByType(classOrInterface:Class):IBead
+		{
+			for each (var bead:IBead in _beads)
+			{
+				if (bead is classOrInterface)
+					return bead;
+			}
+			return null;
+		}
+		
+		public function removeBead(value:IBead):IBead	
+		{
+			var n:int = _beads.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				var bead:IBead = _beads[i];
+				if (bead == value)
+				{
+					_beads.splice(i, 1);
+					return bead;
+				}
+			}
+			return null;
+		}
+		
+		public function initModel():void
+		{
+			
+		}
+		
+		public function addToParent(p:DisplayObjectContainer):void
+		{
+			p.addChild(this);
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/as/src/org/apache/flex/createjs/core/ViewBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/createjs/core/ViewBase.as b/frameworks/as/src/org/apache/flex/createjs/core/ViewBase.as
new file mode 100644
index 0000000..434d6dd
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/createjs/core/ViewBase.as
@@ -0,0 +1,60 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.createjs.core
+{
+	import org.apache.flex.events.Event;
+	import org.apache.flex.utils.MXMLDataInterpreter;
+	
+	[DefaultProperty("mxmlContent")]
+	public class ViewBase extends UIBase
+	{
+		public function ViewBase()
+		{
+			super();
+		}
+		
+		public function initUI(model:Object):void
+		{
+			_applicationModel = model;
+			dispatchEvent(new Event("modelChanged"));
+			MXMLDataInterpreter.generateMXMLProperties(this, MXMLProperties);
+			MXMLDataInterpreter.generateMXMLInstances(this, this, MXMLDescriptor);
+		}
+		
+		public function get MXMLDescriptor():Array
+		{
+			return null;
+		}
+		
+		public function get MXMLProperties():Array
+		{
+			return null;
+		}
+		
+		public var mxmlContent:Array;
+		
+		private var _applicationModel:Object;
+		
+		[Bindable("modelChanged")]
+		public function get applicationModel():Object
+		{
+			return _applicationModel;
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/as/src/org/apache/flex/createjs/staticControls/Label.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/createjs/staticControls/Label.as b/frameworks/as/src/org/apache/flex/createjs/staticControls/Label.as
new file mode 100644
index 0000000..fb8fb7e
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/createjs/staticControls/Label.as
@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.createjs.staticControls
+{
+	import org.apache.flex.html.staticControls.Label;
+	
+	public class Label extends org.apache.flex.html.staticControls.Label
+	{
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/as/src/org/apache/flex/createjs/staticControls/TextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/createjs/staticControls/TextButton.as b/frameworks/as/src/org/apache/flex/createjs/staticControls/TextButton.as
new file mode 100644
index 0000000..c84ea26
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/createjs/staticControls/TextButton.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.createjs.staticControls
+{
+	import flash.display.DisplayObject;
+
+	import org.apache.flex.core.IBead;
+	import org.apache.flex.core.ITextModel;
+	import org.apache.flex.core.IInitModel;
+	import org.apache.flex.core.IInitSkin;
+	import org.apache.flex.core.ValuesManager;
+	import org.apache.flex.html.staticControls.Button;
+	import org.apache.flex.html.staticControls.beads.ITextButtonBead;
+	
+	public class TextButton extends Button implements IInitModel, IInitSkin
+	{
+		public function TextButton(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null,
hitTestState:DisplayObject=null)
+		{
+			super(upState, overState, downState, hitTestState);
+		}
+		
+		public function get text():String
+		{
+			return ITextModel(model).text;
+		}
+		public function set text(value:String):void
+		{
+			ITextModel(model).text = value;
+		}
+		
+		public function get html():String
+		{
+			return ITextModel(model).html;
+		}
+		public function set html(value:String):void
+		{
+			ITextModel(model).html = value;
+		}
+		
+		override public function initModel():void
+		{
+			if (getBeadByType(ITextModel) == null)
+				addBead(new (ValuesManager.valuesImpl.getValue(this, "iTextModel")) as IBead);
+		}
+		
+		override public function initSkin():void
+		{
+			if (getBeadByType(ITextButtonBead) == null)
+				addBead(new (ValuesManager.valuesImpl.getValue(this, "iTextButtonBead")) as IBead);	
	
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
new file mode 100644
index 0000000..bca24ff
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/Application.js
@@ -0,0 +1,147 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// ------------------------------------------------------------------
+// createjs
+// ------------------------------------------------------------------
+
+// Bring in the createjs sources. You can use the minified versions for
+// better performance.
+//var mainjs = document.createElement('script');
+//mainjs.src = './createjs/easeljs-0.6.0.min.js';
+//document.head.appendChild(mainjs);
+
+// ------------------------------------------------------------------
+// end createjs
+// ------------------------------------------------------------------
+ 
+goog.provide('org.apache.flex.createjs.Application');
+
+//goog.require('org.apache.flex.core.HTMLElementWrapper');
+
+goog.require('org.apache.flex.core.SimpleValuesImpl');
+goog.require('org.apache.flex.core.ValuesManager');
+goog.require('org.apache.flex.createjs.core.ViewBase');
+goog.require('org.apache.flex.utils.MXMLDataInterpreter');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.HTMLElementWrapper}
+ */
+org.apache.flex.createjs.Application = function() {
+    org.apache.flex.core.HTMLElementWrapper.call(this);
+
+    /**
+     * @private
+     * @type {Array.<Object>}
+     */
+    this.queuedListeners_;
+
+};
+goog.inherits(org.apache.flex.createjs.Application,
+    org.apache.flex.core.HTMLElementWrapper);
+
+/**
+ * @expose
+ * @type {Object}
+ */
+org.apache.flex.createjs.Application.prototype.controller = null;
+
+/**
+ * @expose
+ * @type {org.apache.flex.createjs.core.ViewBase}
+ */
+org.apache.flex.createjs.Application.prototype.initialView = null;
+
+/**
+ * @expose
+ * @type {createjs.Stage}
+ */
+org.apache.flex.createjs.Application.prototype.stage = null;
+
+/**
+ * @expose
+ * @type {org.apache.flex.events.EventDispatcher}
+ */
+org.apache.flex.createjs.Application.prototype.model = null;
+
+/**
+ * @expose
+ * @type {org.apache.flex.core.SimpleValuesImpl}
+ */
+org.apache.flex.createjs.Application.prototype.valuesImpl = null;
+
+/**
+ * @this {org.apache.flex.createjs.Application}
+ * @param {string} t The event type.
+ * @param {function(?): ?} fn The event handler.
+ */
+org.apache.flex.createjs.Application.prototype.addEventListener = function(t, fn) {
+    if (!this.element) {
+        if (!this.queuedListeners_) {
+            this.queuedListeners_ = [];
+        }
+
+        this.queuedListeners_.push({ type: t, handler: fn });
+
+        return;
+    }
+
+    goog.base(this, 'addEventListener', t, fn);
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.Application}
+ */
+org.apache.flex.createjs.Application.prototype.start = function() {
+    var evt, i, n, q;
+    
+    // For createjs, the application is the same as the canvas
+    // and it provides convenient access to the stage.
+    
+	this.element = document.createElement('canvas');
+	this.element.id = 'flexjsCanvas';
+	this.element.width = 700;
+	this.element.height = 500;
+
+    var body = document.getElementsByTagName('body')[0];
+    body.appendChild(this.element);
+   
+    this.stage = new createjs.Stage("flexjsCanvas");
+
+    if (this.queuedListeners_) {
+        n = this.queuedListeners_.length;
+        for (i = 0; i < n; i++) {
+            q = this.queuedListeners_[i];
+
+            this.addEventListener(q.type, q.handler);
+        }
+    }
+
+    org.apache.flex.utils.MXMLDataInterpreter.generateMXMLProperties(this,
+            this.get_MXMLProperties());
+
+    org.apache.flex.core.ValuesManager.valuesImpl = this.valuesImpl;
+
+    evt = this.createEvent('initialize');
+    this.dispatchEvent(evt);
+
+    this.initialView.addToParent(this.stage);
+    this.initialView.initUI(this.model);
+
+    evt = this.createEvent('viewChanged');
+    this.dispatchEvent(evt);
+};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
new file mode 100644
index 0000000..7c01923
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/UIBase.js
@@ -0,0 +1,146 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.createjs.core.UIBase');
+
+goog.require('org.apache.flex.FlexGlobal');
+goog.require('org.apache.flex.core.HTMLElementWrapper');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.HTMLElementWrapper}
+ */
+org.apache.flex.createjs.core.UIBase = function() {
+    org.apache.flex.core.HTMLElementWrapper.call(this);
+
+    /**
+     * @protected
+     * @type {Object}
+     */
+    this.positioner;
+
+};
+goog.inherits(org.apache.flex.createjs.core.UIBase,
+    org.apache.flex.core.HTMLElementWrapper);
+
+/**
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @param {Object} p The parent element.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.addToParent = function(p) {
+    
+    this.element = new createjs.Container();
+    p.addChild(this.element);
+    
+    this.positioner = this.element;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @param {number} pixels The pixel count from the left edge.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.set_x = function(pixels) {
+    this.positioner.x = pixels;
+    this.element.getStage().update();
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @param {number} pixels The pixel count from the top edge.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.set_y = function(pixels) {
+    this.positioner.y = pixels;
+    this.element.getStage().update();
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @param {number} pixels The pixel count from the left edge.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.set_width = function(pixels) {
+    this.positioner.width = pixels;
+    this.element.getStage().update();
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @param {number} pixels The pixel count from the top edge.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.set_height = function(pixels) {
+    this.positioner.height = pixels;
+    this.element.getStage().update();
+};
+
+/**
+ * @expose
+ * @type {string}
+ */
+org.apache.flex.createjs.core.UIBase.prototype.id;
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @return {string} The id.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.get_id = function() {
+    return this.name;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @param {object} value The new id.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.set_id = function(value) {
+    if (this.name != value)
+    {
+        this.element.name = value;
+        this.name = value;
+        var evt = this.createEvent('idChanged');
+        this.dispatchEvent(evt);
+    }
+};
+
+/**
+ * @expose
+ * @type {object}
+ */
+org.apache.flex.createjs.core.UIBase.prototype.model;
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @return {object} The model.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.get_model = function() {
+    return this.model;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.core.UIBase}
+ * @param {object} value The new model.
+ */
+org.apache.flex.createjs.core.UIBase.prototype.set_model = function(value) {
+    if (this.model != value)
+    {
+        this.addBead(value);
+        this.dispatchEvent(new Event('modelChanged'));
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js
new file mode 100644
index 0000000..03edf7f
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/core/ViewBase.js
@@ -0,0 +1,66 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.createjs.core.ViewBase');
+
+goog.require('org.apache.flex.FlexGlobal');
+
+goog.require('org.apache.flex.createjs.core.UIBase');
+
+goog.require('org.apache.flex.utils.MXMLDataInterpreter');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.createjs.core.UIBase}
+ */
+org.apache.flex.createjs.core.ViewBase = function() {
+    org.apache.flex.createjs.core.UIBase.call(this);
+
+     /**
+      * @private
+      * @type {org.apache.flex.createjs.core.ViewBase}
+      */
+      this.currentObject_;
+};
+goog.inherits(org.apache.flex.createjs.core.ViewBase, org.apache.flex.createjs.core.UIBase);
+
+/**
+ * @expose
+ * @type {Object}
+ */
+org.apache.flex.createjs.core.ViewBase.prototype.applicationModel;
+
+/**
+ * @expose
+ * @type {Array}
+ */
+org.apache.flex.createjs.core.ViewBase.prototype.MXMLProperties;
+
+/**
+ * @expose
+ * @type {Array}
+ */
+org.apache.flex.createjs.core.ViewBase.prototype.MXMLDescriptor;
+
+/**
+ * @this {org.apache.flex.createjs.core.ViewBase}
+ * @param {Object} model The model for this view.
+ */
+org.apache.flex.createjs.core.ViewBase.prototype.initUI = function(model) {
+    this.applicationModel = model;
+    org.apache.flex.utils.MXMLDataInterpreter.generateMXMLProperties(this,
+            this.get_MXMLProperties());
+    org.apache.flex.utils.MXMLDataInterpreter.generateMXMLInstances(this,
+            this, this.get_MXMLDescriptor());
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/Label.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/Label.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/Label.js
new file mode 100644
index 0000000..8663426
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/Label.js
@@ -0,0 +1,65 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.createjs.staticControls.Label');
+
+goog.require('org.apache.flex.createjs.core.UIBase');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.createjs.core.UIBase}
+ */
+org.apache.flex.createjs.staticControls.Label = function() {
+    org.apache.flex.createjs.core.UIBase.call(this);
+};
+goog.inherits(
+    org.apache.flex.createjs.staticControls.Label, org.apache.flex.createjs.core.UIBase
+);
+
+/**
+ * @override
+ * @this {org.apache.flex.createjs.staticControls.Label}
+ * @param {Object} p The parent element.
+ */
+org.apache.flex.createjs.staticControls.Label.prototype.addToParent = function(p) {
+    goog.base(this, 'addToParent', p);
+    
+    this.element = new createjs.Text("default text", "20px Arial", "#ff7700");
+ 	this.element.x = 0;
+ 	this.element.y = 20;
+ 	this.element.textBaseline = "alphabetic";
+ 	p.addChild(this.element);
+ 	p.getStage().update();
+
+    this.positioner = this.element;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.Label}
+ * @return {string} The text getter.
+ */
+org.apache.flex.createjs.staticControls.Label.prototype.get_text = function() {
+    return this.element.text;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.Label}
+ * @param {string} value The text setter.
+ */
+org.apache.flex.createjs.staticControls.Label.prototype.set_text = function(value) {
+    this.element.text = value;
+    this.element.getStage().update();
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/947a1785/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/TextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/TextButton.js
b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/TextButton.js
new file mode 100644
index 0000000..41de47d
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/TextButton.js
@@ -0,0 +1,79 @@
+/**
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+goog.provide('org.apache.flex.createjs.staticControls.TextButton');
+
+goog.require('org.apache.flex.createjs.core.UIBase');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.createjs.core.UIBase}
+ */
+org.apache.flex.createjs.staticControls.TextButton = function() {
+    org.apache.flex.createjs.core.UIBase.call(this);
+};
+goog.inherits(
+    org.apache.flex.createjs.staticControls.TextButton, org.apache.flex.createjs.core.UIBase
+);
+
+org.apache.flex.createjs.staticControls.TextButton.prototype.buttonLabel = null;
+org.apache.flex.createjs.staticControls.TextButton.prototype.buttonBackground = null;
+
+/**
+ * @override
+ * @this {org.apache.flex.createjs.staticControls.TextButton}
+ * @param {Object} p The parent element.
+ */
+org.apache.flex.createjs.staticControls.TextButton.prototype.addToParent =
+    function(p) {
+    
+    this.buttonBackground = new createjs.Shape();
+	this.buttonBackground.name = "background";
+	this.buttonBackground.graphics.beginFill("red").drawRoundRect(0, 0, 200, 60, 10);
+	
+	this.buttonLabel = new createjs.Text("button", "bold 24px Arial", "#FFFFFF");
+	this.buttonLabel.name = "label";
+	this.buttonLabel.textAlign = "center";
+	this.buttonLabel.textBaseline = "middle";
+	this.buttonLabel.x = 200/2;
+	this.buttonLabel.y = 60/2;
+	
+	this.element = new createjs.Container();
+	this.element.name = "button";
+	this.element.x = 50;
+	this.element.y = 25;
+	this.element.addChild(this.buttonBackground, this.buttonLabel);
+	p.addChild(this.element);
+
+    this.positioner = this.element;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.TextButton}
+ * @return {string} The text getter.
+ */
+org.apache.flex.createjs.staticControls.TextButton.prototype.get_text = function() {
+    return this.buttonLabel.text;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.TextButton}
+ * @param {string} value The text setter.
+ */
+org.apache.flex.createjs.staticControls.TextButton.prototype.set_text =
+    function(value) {
+    this.buttonLabel.text = value;
+};


Mime
View raw message