You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2013/05/03 01:56:04 UTC

[1/9] git commit: [flex-asjs] [refs/heads/develop] - checkbox control for creates. selected property works but clicking on it does not update visual state

Updated Branches:
  refs/heads/develop 91f330b3a -> 355f113c8


checkbox control for creates. selected property works but clicking on it does not update visual state


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

Branch: refs/heads/develop
Commit: 11360ac0c28c2d5f762d40bf6e0f0a51eaabad44
Parents: 128e84c
Author: Carlos Rovira <ca...@gmail.com>
Authored: Tue Apr 30 00:53:19 2013 +0200
Committer: Carlos Rovira <ca...@gmail.com>
Committed: Tue Apr 30 00:53:19 2013 +0200

----------------------------------------------------------------------
 frameworks/as/createjs-manifest.xml                |    1 +
 frameworks/as/defaults.css                         |    4 +
 .../flex/createjs/staticControls/CheckBox.as       |   26 ++++
 .../flex/createjs/staticControls/CheckBox.js       |  103 +++++++++++++++
 4 files changed, 134 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11360ac0/frameworks/as/createjs-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/createjs-manifest.xml b/frameworks/as/createjs-manifest.xml
index f856cdf..c72090c 100644
--- a/frameworks/as/createjs-manifest.xml
+++ b/frameworks/as/createjs-manifest.xml
@@ -26,5 +26,6 @@
     <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"/>
+    <component id="CheckBox" class="org.apache.flex.createjs.staticControls.CheckBox"/>
 
 </componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11360ac0/frameworks/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/as/defaults.css b/frameworks/as/defaults.css
index 64caf16..426cb47 100644
--- a/frameworks/as/defaults.css
+++ b/frameworks/as/defaults.css
@@ -175,5 +175,9 @@ createjs|TextButton
         ITextButtonBead: ClassReference("org.apache.flex.html.staticControls.beads.TextButtonBead");
 }
 
+createjs|CheckBox
+{
+        ICheckBoxBead: ClassReference("org.apache.flex.html.staticControls.beads.CheckBoxBead");
+}
 
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11360ac0/frameworks/as/src/org/apache/flex/createjs/staticControls/CheckBox.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/createjs/staticControls/CheckBox.as b/frameworks/as/src/org/apache/flex/createjs/staticControls/CheckBox.as
new file mode 100644
index 0000000..b4dc469
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/createjs/staticControls/CheckBox.as
@@ -0,0 +1,26 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.CheckBox;
+	
+	public class CheckBox extends org.apache.flex.html.staticControls.CheckBox
+	{	
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11360ac0/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
new file mode 100644
index 0000000..65c3c19
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
@@ -0,0 +1,103 @@
+/**
+ * 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.CheckBox');
+
+goog.require('org.apache.flex.createjs.core.UIBase');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.createjs.core.UIBase}
+ */
+org.apache.flex.createjs.staticControls.CheckBox = function() {
+    org.apache.flex.createjs.core.UIBase.call(this);
+};
+goog.inherits(
+    org.apache.flex.createjs.staticControls.CheckBox, org.apache.flex.createjs.core.UIBase
+);
+
+org.apache.flex.createjs.staticControls.TextButton.prototype.checkMark = null;
+org.apache.flex.createjs.staticControls.TextButton.prototype.checkMarkBackground = null;
+org.apache.flex.createjs.staticControls.TextButton.prototype.checkBoxLabel = null;
+org.apache.flex.createjs.staticControls.TextButton.prototype.selected = false;
+
+/**
+ * @override
+ * @this {org.apache.flex.createjs.staticControls.CheckBox}
+ * @param {Object} p The parent element.
+ */
+org.apache.flex.createjs.staticControls.CheckBox.prototype.addToParent = function(p)
+{	
+	this.checkMarkBackground = new createjs.Shape();
+	this.checkMarkBackground.name = "checkmarkbackground";
+	this.checkMarkBackground.graphics.beginFill("red").drawRoundRect(0, 0, 40, 40, 8);
+	
+	this.checkMark = new createjs.Shape();
+	this.checkMark.name = "checkmark";
+	this.checkMark.graphics.beginFill("white").drawRoundRect(0, 0, 32, 32, 6);
+	this.checkMark.x = 4;
+	this.checkMark.y = 4;
+	this.checkMark.visible = this.selected;
+		
+	this.checkBoxLabel = new createjs.Text("checkbox", "20px Arial", "#ff7700");
+	this.checkBoxLabel.name = "label";
+	this.checkBoxLabel.textAlign = "left";
+	this.checkBoxLabel.textBaseline = "middle";
+	this.checkBoxLabel.x = 45;
+	this.checkBoxLabel.y = 40/2;
+	
+	this.element = new createjs.Container();
+	this.element.name = "checkbox";
+	this.element.addChild(this.checkMarkBackground, this.checkBoxLabel, this.checkMark);
+	p.addChild(this.element);
+
+    this.positioner = this.element;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.CheckBox}
+ * @return {string} The text getter.
+ */
+org.apache.flex.createjs.staticControls.CheckBox.prototype.get_text = function() {
+    return this.checkBoxLabel.text;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.CheckBox}
+ * @param {string} value The text setter.
+ */
+org.apache.flex.createjs.staticControls.CheckBox.prototype.set_text = function(value) {
+    this.checkBoxLabel.text = value;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.CheckBox}
+ * @return {bool} The selected getter.
+ */
+org.apache.flex.createjs.staticControls.CheckBox.prototype.get_selected = function() {
+    return this.selected;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.CheckBox}
+ * @param {bool} value The selected setter.
+ */
+org.apache.flex.createjs.staticControls.CheckBox.prototype.set_selected = function(value) {
+	this.checkMark.visible = this.selected = value;
+	this.element.getStage().update();
+};


[5/9] git commit: [flex-asjs] [refs/heads/develop] - fix checkbox prototype varaibles

Posted by ca...@apache.org.
fix checkbox prototype varaibles


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

Branch: refs/heads/develop
Commit: cd458ecd6614300fcf60a9a724dc64458e380b8c
Parents: 0080d0f
Author: Carlos Rovira <ca...@apache.org>
Authored: Thu May 2 16:33:37 2013 +0200
Committer: Carlos Rovira <ca...@apache.org>
Committed: Thu May 2 16:33:37 2013 +0200

----------------------------------------------------------------------
 .../flex/createjs/staticControls/CheckBox.js       |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cd458ecd/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
index 65c3c19..f460541 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
@@ -27,10 +27,10 @@ goog.inherits(
     org.apache.flex.createjs.staticControls.CheckBox, org.apache.flex.createjs.core.UIBase
 );
 
-org.apache.flex.createjs.staticControls.TextButton.prototype.checkMark = null;
-org.apache.flex.createjs.staticControls.TextButton.prototype.checkMarkBackground = null;
-org.apache.flex.createjs.staticControls.TextButton.prototype.checkBoxLabel = null;
-org.apache.flex.createjs.staticControls.TextButton.prototype.selected = false;
+org.apache.flex.createjs.staticControls.CheckBox.prototype.checkMark = null;
+org.apache.flex.createjs.staticControls.CheckBox.prototype.checkMarkBackground = null;
+org.apache.flex.createjs.staticControls.CheckBox.prototype.checkBoxLabel = null;
+org.apache.flex.createjs.staticControls.CheckBox.prototype.selected = false;
 
 /**
  * @override


[7/9] git commit: [flex-asjs] [refs/heads/develop] - Merge branch 'develop' into feature/createjs-checkbox

Posted by ca...@apache.org.
Merge branch 'develop' into feature/createjs-checkbox

* develop:
  fix undefined getter (falback to property)


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

Branch: refs/heads/develop
Commit: 44e73e5220036ce95c565b68f3420ea6066b55de
Parents: 6832c37 91f330b
Author: Carlos Rovira <ca...@apache.org>
Authored: Thu May 2 23:30:31 2013 +0200
Committer: Carlos Rovira <ca...@apache.org>
Committed: Thu May 2 23:30:31 2013 +0200

----------------------------------------------------------------------
 .../src/org/apache/flex/binding/SimpleBinding.js   |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
----------------------------------------------------------------------



[4/9] git commit: [flex-asjs] [refs/heads/develop] - Merge branch 'develop' into feature/createjs-checkbox

Posted by ca...@apache.org.
Merge branch 'develop' into feature/createjs-checkbox

# By Alex Harui
# Via Alex Harui
* develop:
  use getters otherwise it won't work when minified
  add missing value and selectedValue properties to JS side
  fix event dispatch, add missing getter
  implement visible property in JS
  add missing event metadata, otherwise compiler will use flash.events.Event


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

Branch: refs/heads/develop
Commit: 0080d0f35e0ccabec8efcf35fe18d062379ee190
Parents: 671e059 af7677e
Author: Carlos Rovira <ca...@apache.org>
Authored: Wed May 1 23:57:54 2013 +0200
Committer: Carlos Rovira <ca...@apache.org>
Committed: Wed May 1 23:57:54 2013 +0200

----------------------------------------------------------------------
 .../apache/flex/html/staticControls/CheckBox.as    |    2 +
 .../apache/flex/html/staticControls/RadioButton.as |    2 +
 .../src/org/apache/flex/binding/ConstantBinding.js |    2 +-
 .../src/org/apache/flex/binding/SimpleBinding.js   |    2 +-
 .../js/FlexJS/src/org/apache/flex/core/UIBase.js   |   40 +++++++++++
 .../js/FlexJS/src/org/apache/flex/core/ViewBase.js |   11 +++
 .../apache/flex/html/staticControls/RadioButton.js |   54 +++++++++++++++
 7 files changed, 111 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[9/9] git commit: [flex-asjs] [refs/heads/develop] - Merge branch 'feature/createjs-checkbox' into develop

Posted by ca...@apache.org.
Merge branch 'feature/createjs-checkbox' into develop

* feature/createjs-checkbox:
  fix createjs checkbox, now working properly
  fix checkbox prototype varaibles
  update createjs sample with checkbox control. button event updates selected property to see control change externaly.
  checkbox control for creates. selected property works but clicking on it does not update visual state


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

Branch: refs/heads/develop
Commit: 355f113c827e333e743fd8996330d98076e7cd69
Parents: 91f330b a528433
Author: Carlos Rovira <ca...@apache.org>
Authored: Fri May 3 01:55:51 2013 +0200
Committer: Carlos Rovira <ca...@apache.org>
Committed: Fri May 3 01:55:51 2013 +0200

----------------------------------------------------------------------
 .../FlexJSTest_createjs/src/MyInitialView.mxml     |    7 +-
 frameworks/as/createjs-manifest.xml                |    1 +
 frameworks/as/defaults.css                         |    4 +
 .../flex/createjs/staticControls/CheckBox.as       |   26 ++++
 .../flex/createjs/staticControls/CheckBox.js       |  117 +++++++++++++++
 5 files changed, 153 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[2/9] git commit: [flex-asjs] [refs/heads/develop] - update createjs sample with checkbox control. button event updates selected property to see control change externaly.

Posted by ca...@apache.org.
update createjs sample with checkbox control. button event updates selected property to see control change externaly.


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

Branch: refs/heads/develop
Commit: a898de058820754aabdcdcd49b23a888551d2331
Parents: 11360ac
Author: Carlos Rovira <ca...@gmail.com>
Authored: Tue Apr 30 00:54:43 2013 +0200
Committer: Carlos Rovira <ca...@gmail.com>
Committed: Tue Apr 30 00:54:43 2013 +0200

----------------------------------------------------------------------
 .../FlexJSTest_createjs/src/MyInitialView.mxml     |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a898de05/examples/FlexJSTest_createjs/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSTest_createjs/src/MyInitialView.mxml b/examples/FlexJSTest_createjs/src/MyInitialView.mxml
index 2e7a9b2..d972b99 100644
--- a/examples/FlexJSTest_createjs/src/MyInitialView.mxml
+++ b/examples/FlexJSTest_createjs/src/MyInitialView.mxml
@@ -35,6 +35,7 @@ limitations under the License.
 			{
 				dispatchEvent( new org.apache.flex.events.Event("pushme2Clicked") );
 				
+				check1.selected = !check1.selected;
 			}
 		]]>
 	</fx:Script>
@@ -50,6 +51,8 @@ limitations under the License.
 								 destinationPropertyName="text" />
 		</createjs:beads>
 	</createjs:Label>
-	<createjs:TextButton x="350" y="225" text="Change Label" click="changeLabel()" />
-
+	<createjs:TextButton x="350" y="225" text="Change Label" click="changeLabel()"/>
+	
+	<createjs:CheckBox id="check1" x="10" y="10" text="Check Me" selected="true"/>
+	
 </createjs:ViewBase>
\ No newline at end of file


[3/9] git commit: [flex-asjs] [refs/heads/develop] - Merge branch 'develop' into feature/createjs-checkbox

Posted by ca...@apache.org.
Merge branch 'develop' into feature/createjs-checkbox

# By Alex Harui (4) and Carlos Rovira (1)
* develop:
  [CreateJS] fixed type coercion with flash.events.Event in Application
  Selection Model should send selectedIndexChanged as well when selectedItem changed
  add initComplete event sort of like creationComplete in current Flex SDK
  Handle MXML views not having any styles
  SimpleBinding must use flash.Events on the AS side for click and other mouse events


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

Branch: refs/heads/develop
Commit: 671e059eabdc153f2a0a56bd212c604596801929
Parents: a898de0 138cf91
Author: Carlos Rovira <ca...@apache.org>
Authored: Wed May 1 19:24:07 2013 +0200
Committer: Carlos Rovira <ca...@apache.org>
Committed: Wed May 1 19:24:07 2013 +0200

----------------------------------------------------------------------
 .../src/org/apache/flex/binding/SimpleBinding.as   |    5 +++--
 .../org/apache/flex/core/SimpleCSSValuesImpl.as    |    5 +++++
 frameworks/as/src/org/apache/flex/core/ViewBase.as |    3 +++
 .../as/src/org/apache/flex/createjs/Application.as |    2 +-
 .../beads/models/ArraySelectionModel.as            |    1 +
 5 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[6/9] git commit: [flex-asjs] [refs/heads/develop] - Merge branch 'develop' into feature/createjs-checkbox

Posted by ca...@apache.org.
Merge branch 'develop' into feature/createjs-checkbox

# By Alex Harui
# Via Alex Harui
* develop:
  tweak some colors
  improve css and default sizes


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

Branch: refs/heads/develop
Commit: 6832c37bcff35ece3ce94fbf094b5478159d9580
Parents: cd458ec 2b7ee0a
Author: Carlos Rovira <ca...@apache.org>
Authored: Thu May 2 16:34:58 2013 +0200
Committer: Carlos Rovira <ca...@apache.org>
Committed: Thu May 2 16:34:58 2013 +0200

----------------------------------------------------------------------
 frameworks/as/defaults.css                         |    8 ++++++++
 .../as/src/org/apache/flex/core/CSSTextField.as    |   11 ++++++-----
 frameworks/as/src/org/apache/flex/core/UIBase.as   |    8 ++++++--
 .../html/staticControls/beads/DropDownListBead.as  |    8 ++++----
 .../html/staticControls/beads/TextFieldBeadBase.as |   10 ++++++++++
 .../supportClasses/TextFieldItemRenderer.as        |    6 +++---
 6 files changed, 37 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6832c37b/frameworks/as/defaults.css
----------------------------------------------------------------------


[8/9] git commit: [flex-asjs] [refs/heads/develop] - fix createjs checkbox, now working properly

Posted by ca...@apache.org.
fix createjs checkbox, now working properly


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

Branch: refs/heads/develop
Commit: a528433fac7328f1559ca9bb2ce6a22d20e40524
Parents: 44e73e5
Author: Carlos Rovira <ca...@apache.org>
Authored: Fri May 3 01:54:53 2013 +0200
Committer: Carlos Rovira <ca...@apache.org>
Committed: Fri May 3 01:54:53 2013 +0200

----------------------------------------------------------------------
 .../flex/createjs/staticControls/CheckBox.js       |   20 ++++++++++++--
 1 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a528433f/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
index f460541..5a2ae5c 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/createjs/staticControls/CheckBox.js
@@ -30,7 +30,6 @@ goog.inherits(
 org.apache.flex.createjs.staticControls.CheckBox.prototype.checkMark = null;
 org.apache.flex.createjs.staticControls.CheckBox.prototype.checkMarkBackground = null;
 org.apache.flex.createjs.staticControls.CheckBox.prototype.checkBoxLabel = null;
-org.apache.flex.createjs.staticControls.CheckBox.prototype.selected = false;
 
 /**
  * @override
@@ -42,7 +41,11 @@ org.apache.flex.createjs.staticControls.CheckBox.prototype.addToParent = functio
 	this.checkMarkBackground = new createjs.Shape();
 	this.checkMarkBackground.name = "checkmarkbackground";
 	this.checkMarkBackground.graphics.beginFill("red").drawRoundRect(0, 0, 40, 40, 8);
-	
+	//this.checkMarkBackground.graphics.setStrokeStyle( 0 ).beginStroke( '#000' ).drawRect( 0, 0, this.width, this.height);
+	//var hit = new createjs.Shape();
+	//hit.graphics.beginFill("#000").drawRect(0, 0, this.width, this.height);
+	//this.checkMarkBackground.hitArea = hit;
+
 	this.checkMark = new createjs.Shape();
 	this.checkMark.name = "checkmark";
 	this.checkMark.graphics.beginFill("white").drawRoundRect(0, 0, 32, 32, 6);
@@ -56,10 +59,13 @@ org.apache.flex.createjs.staticControls.CheckBox.prototype.addToParent = functio
 	this.checkBoxLabel.textBaseline = "middle";
 	this.checkBoxLabel.x = 45;
 	this.checkBoxLabel.y = 40/2;
-	
+
 	this.element = new createjs.Container();
 	this.element.name = "checkbox";
 	this.element.addChild(this.checkMarkBackground, this.checkBoxLabel, this.checkMark);
+	// use bind(this) to avoid loose scope
+	this.element.onClick = this.clickHandler.bind(this);
+
 	p.addChild(this.element);
 
     this.positioner = this.element;
@@ -101,3 +107,11 @@ org.apache.flex.createjs.staticControls.CheckBox.prototype.set_selected = functi
 	this.checkMark.visible = this.selected = value;
 	this.element.getStage().update();
 };
+
+/**
+ * @expose
+ * @this {org.apache.flex.createjs.staticControls.CheckBox}
+ */
+org.apache.flex.createjs.staticControls.CheckBox.prototype.clickHandler = function(event) {
+	this.set_selected(!this.get_selected());
+};