flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject [2/3] git commit: [flex-asjs] [refs/heads/develop] - Adjust ActionScript and JavaScript versions to produce like results.
Date Wed, 07 Jan 2015 12:30:32 GMT
Adjust ActionScript and JavaScript versions to produce like results.


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

Branch: refs/heads/develop
Commit: e845c6e57460252b3315b6b9ec43ec9cc83cb532
Parents: c59a990
Author: Peter Ent <pent@apache.org>
Authored: Wed Jan 7 07:29:52 2015 -0500
Committer: Peter Ent <pent@apache.org>
Committed: Wed Jan 7 07:29:52 2015 -0500

----------------------------------------------------------------------
 .../org/apache/flex/events/utils/MouseUtils.as  | 26 ++++++++++++++++++++
 .../org/apache/flex/events/utils/MouseUtils.js  | 20 ++++++++++++++-
 2 files changed, 45 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e845c6e5/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
index de2add3..f22d91c 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseUtils.as
@@ -73,5 +73,31 @@ package org.apache.flex.events.utils
 		{
 			return event.localY;
 		}
+		
+		/**
+		 *  Returns the globel X value.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		static public function globalX(event:MouseEvent):Number
+		{
+			return event.stageX;
+		}
+		
+		/**
+		 *  Returns the global Y value.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		static public function globalY(event:MouseEvent):Number
+		{
+			return event.stageY;
+		}
 	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e845c6e5/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js b/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js
index 9ec27eb..4d8048d 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/events/utils/MouseUtils.js
@@ -31,7 +31,7 @@ org.apache.flex.events.utils.MouseUtils.eventTarget = function(event) {
  * @return {number} The x position of the mouse with respect to its parent.
  */
 org.apache.flex.events.utils.MouseUtils.localX = function(event) {
-  return event.clientX;
+  return event.offsetX;
 };
 
 
@@ -40,5 +40,23 @@ org.apache.flex.events.utils.MouseUtils.localX = function(event) {
  * @return {number} The y position of the mouse with respect to its parent.
  */
 org.apache.flex.events.utils.MouseUtils.localY = function(event) {
+  return event.offsetY;
+};
+
+
+/**
+ * @param {Object} event The event.
+ * @return {number} The x position of the mouse with respect to the screen.
+ */
+org.apache.flex.events.utils.MouseUtils.globalX = function(event) {
+  return event.clientX;
+};
+
+
+/**
+ * @param {Object} event The event.
+ * @return {number} The y position of the mouse with respect to the screen.
+ */
+org.apache.flex.events.utils.MouseUtils.globalY = function(event) {
   return event.clientY;
 };


Mime
View raw message