flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [03/23] git commit: [flex-asjs] [refs/heads/develop] - upgrade mouse event conversion logic. hopefully now all bugs are fixed
Date Wed, 29 Oct 2014 18:15:58 GMT
upgrade mouse event conversion logic.  hopefully now all bugs are fixed


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

Branch: refs/heads/develop
Commit: 2ffcde11eb797d1933cc3fbc2f1856fc9c57a222
Parents: 2c96825
Author: Alex Harui <aharui@apache.org>
Authored: Mon Oct 27 11:29:25 2014 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Wed Oct 29 11:15:41 2014 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/core/Application.as     |  31 +---
 .../FlexJSUI/src/org/apache/flex/core/UIBase.as |  43 ++---
 .../src/org/apache/flex/core/UIButtonBase.as    |  53 +++---
 .../src/org/apache/flex/events/MouseEvent.as    |  25 +--
 .../flex/events/utils/MouseEventConverter.as    | 165 +++++++++++++++++++
 .../supportClasses/TextFieldItemRenderer.as     |   8 +-
 6 files changed, 220 insertions(+), 105 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2ffcde11/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
index 99418c0..7ff9660 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/Application.as
@@ -32,6 +32,7 @@ package org.apache.flex.core
     import org.apache.flex.events.Event;
     import org.apache.flex.events.IEventDispatcher;
     import org.apache.flex.events.MouseEvent;
+    import org.apache.flex.events.utils.MouseEventConverter;
     import org.apache.flex.utils.MXMLDataInterpreter;
     
     //--------------------------------------
@@ -104,37 +105,11 @@ package org.apache.flex.core
 				stage.align = StageAlign.TOP_LEFT;
 				stage.scaleMode = StageScaleMode.NO_SCALE;
                 // should be opt-in
-				//stage.quality = StageQuality.HIGH_16X16_LINEAR;
-                
-                stage.addEventListener(flash.events.MouseEvent.CLICK, mouseEventKiller, true,
9999);
-                stage.addEventListener(flash.events.MouseEvent.MOUSE_DOWN, mouseEventKiller,
true, 9999);
-                stage.addEventListener(flash.events.MouseEvent.MOUSE_UP, mouseEventKiller,
true, 9999);
-                stage.addEventListener(flash.events.MouseEvent.ROLL_OVER, mouseEventKiller,
true, 9999);
-                stage.addEventListener(flash.events.MouseEvent.ROLL_OUT, mouseEventKiller,
true, 9999);
-                stage.addEventListener(flash.events.MouseEvent.MOUSE_OVER, mouseEventKiller,
true, 9999);
-                stage.addEventListener(flash.events.MouseEvent.MOUSE_OUT, mouseEventKiller,
true, 9999);
-                stage.addEventListener(flash.events.MouseEvent.MOUSE_MOVE, mouseEventKiller,
true, 9999);
+				//stage.quality = StageQuality.HIGH_16X16_LINEAR;                
 			}
 			
             loaderInfo.addEventListener(flash.events.Event.INIT, initHandler);
         }
-
-        private function mouseEventKiller(event:flash.events.Event):void
-        {
-            if (event is flash.events.MouseEvent && (!(event is org.apache.flex.events.MouseEvent)))
-            {
-                var newEvent:org.apache.flex.events.MouseEvent = 
-                    org.apache.flex.events.MouseEvent.convert(flash.events.MouseEvent(event));
-                if (newEvent) 
-                {
-                    // some events are not converted if there are no JS equivalents
-                    event.stopImmediatePropagation();
-                    event.target.dispatchEvent(newEvent);
-                }
-                else
-                    trace("did not convert", event.type);
-            }
-        }
         
         /**
          *  The document property is used to provide
@@ -150,6 +125,8 @@ package org.apache.flex.core
         
         private function initHandler(event:flash.events.Event):void
         {
+            MouseEventConverter.setupAllConverters(stage);
+                
             for each (var bead:IBead in beads)
                 addBead(bead);
                 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2ffcde11/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as
index 3f18fe2..deb1c2f 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIBase.as
@@ -20,12 +20,11 @@ package org.apache.flex.core
 {
 	import flash.display.DisplayObject;
 	import flash.display.Sprite;
-	import flash.events.Event;
-	import flash.events.MouseEvent;
 	
 	import org.apache.flex.events.Event;
 	import org.apache.flex.events.IEventDispatcher;
 	import org.apache.flex.events.MouseEvent;
+    import org.apache.flex.events.utils.MouseEventConverter;
 	
 	/**
 	 *  Set a different class for click events so that
@@ -146,9 +145,11 @@ package org.apache.flex.core
          */
 		public function UIBase()
 		{
-			super();			
-		}
-				
+			super();
+            
+            MouseEventConverter.setupInstanceConverters(this);
+        }
+        
 		private var _explicitWidth:Number;
         
         /**
@@ -179,7 +180,7 @@ package org.apache.flex.core
 			
 			_explicitWidth = value;
 			
-			dispatchEvent(new org.apache.flex.events.Event("explicitWidthChanged"));
+			dispatchEvent(new Event("explicitWidthChanged"));
 		}
 		
 		private var _explicitHeight:Number;
@@ -212,7 +213,7 @@ package org.apache.flex.core
 			
 			_explicitHeight = value;
 			
-			dispatchEvent(new org.apache.flex.events.Event("explicitHeightChanged"));
+			dispatchEvent(new Event("explicitHeightChanged"));
 		}
 		
 		private var _percentWidth:Number;
@@ -247,7 +248,7 @@ package org.apache.flex.core
 			
 			_percentWidth = value;
 			
-			dispatchEvent(new org.apache.flex.events.Event("percentWidthChanged"));
+			dispatchEvent(new Event("percentWidthChanged"));
 		}
 
         private var _percentHeight:Number;
@@ -282,7 +283,7 @@ package org.apache.flex.core
 			
 			_percentHeight = value;
 			
-			dispatchEvent(new org.apache.flex.events.Event("percentHeightChanged"));
+			dispatchEvent(new Event("percentHeightChanged"));
 		}
 		
 		private var _width:Number;
@@ -415,7 +416,7 @@ package org.apache.flex.core
             {
                 _height = value;
                 if (!noEvent)
-                    dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+                    dispatchEvent(new Event("heightChanged"));
             }            
         }
 
@@ -433,7 +434,7 @@ package org.apache.flex.core
             {
                 _width = value;
                 if (!noEvent)
-                    dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+                    dispatchEvent(new Event("widthChanged"));
             }
         }
         
@@ -452,15 +453,15 @@ package org.apache.flex.core
                 _width = newWidth;
                 if (_height == newHeight)
                     if (!noEvent) 
-                        dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+                        dispatchEvent(new Event("widthChanged"));
             }
             if (_height != newHeight)
             {
                 _height = newHeight;
                 if (!noEvent)
-                    dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+                    dispatchEvent(new Event("heightChanged"));
             }            
-            dispatchEvent(new org.apache.flex.events.Event("sizeChanged"));
+            dispatchEvent(new Event("sizeChanged"));
         }
         
         /**
@@ -517,7 +518,7 @@ package org.apache.flex.core
 			if (_model != value)
 			{
 				addBead(value as IBead);
-				dispatchEvent(new org.apache.flex.events.Event("modelChanged"));
+				dispatchEvent(new Event("modelChanged"));
 			}
 		}
 		
@@ -556,7 +557,7 @@ package org.apache.flex.core
             if (_view != value)
             {
                 addBead(value as IBead);
-                dispatchEvent(new org.apache.flex.events.Event("viewChanged"));
+                dispatchEvent(new Event("viewChanged"));
             }
         }
 
@@ -583,7 +584,7 @@ package org.apache.flex.core
 			if (_id != value)
 			{
 				_id = value;
-				dispatchEvent(new org.apache.flex.events.Event("idChanged"));
+				dispatchEvent(new Event("idChanged"));
 			}
 		}
 		
@@ -619,7 +620,7 @@ package org.apache.flex.core
                 }
                 else
                     _styles = value;
-                dispatchEvent(new org.apache.flex.events.Event("stylesChanged"));
+                dispatchEvent(new Event("stylesChanged"));
             }
         }
         
@@ -647,7 +648,7 @@ package org.apache.flex.core
 			if (_className != value)
 			{
 				_className = value;
-				dispatchEvent(new org.apache.flex.events.Event("classNameChanged"));
+				dispatchEvent(new Event("classNameChanged"));
 			}
 		}
         
@@ -696,7 +697,7 @@ package org.apache.flex.core
 			bead.strand = this;
 			
 			if (bead is IBeadView) {
-				IEventDispatcher(this).dispatchEvent(new org.apache.flex.events.Event("viewChanged"));
+				IEventDispatcher(this).dispatchEvent(new Event("viewChanged"));
 			}
 		}
 		
@@ -883,7 +884,7 @@ package org.apache.flex.core
                         addBead(controller);
                 }
             }
-            dispatchEvent(new org.apache.flex.events.Event("beadsAdded"));
+            dispatchEvent(new Event("beadsAdded"));
         }
         		
         /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2ffcde11/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
index c942654..226d69d 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/UIButtonBase.as
@@ -20,7 +20,6 @@ package org.apache.flex.core
 {
 	import flash.display.DisplayObject;
 	import flash.display.SimpleButton;
-	import flash.events.MouseEvent;
 	
 	import org.apache.flex.core.IBead;
 	import org.apache.flex.core.IBeadModel;
@@ -29,6 +28,7 @@ package org.apache.flex.core
 	import org.apache.flex.core.IUIBase;
 	import org.apache.flex.core.ValuesManager;
 	import org.apache.flex.events.Event;
+    import org.apache.flex.events.utils.MouseEventConverter;
 	import org.apache.flex.events.IEventDispatcher;
 	
     //--------------------------------------
@@ -45,7 +45,7 @@ package org.apache.flex.core
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-	[Event(name="click", type="org.apache.flex.events.Event")]
+	[Event(name="click", type="org.apache.flex.events.MouseEvent")]
 
     /**
      *  The UIButtonBase class is the base class for most Buttons in a FlexJS
@@ -72,16 +72,7 @@ package org.apache.flex.core
 			super(upState, overState, downState, hitTestState);
 			// mouseChildren = true;
 			// mouseEnabled = true;
-			addEventListener(MouseEvent.CLICK, clickKiller, false, 9999); 
-		}
-		
-		private function clickKiller(event:flash.events.Event):void
-		{
-			if (event is MouseEvent)
-			{
-				event.stopImmediatePropagation();
-				dispatchEvent(new org.apache.flex.events.Event("click"));
-			}
+            MouseEventConverter.setupInstanceConverters(this);
 		}
 				
 		/**
@@ -91,7 +82,7 @@ package org.apache.flex.core
 		{
 			if (super.x != value) {
 				super.x = value;
-				dispatchEvent(new org.apache.flex.events.Event("xChanged"));
+				dispatchEvent(new Event("xChanged"));
 			}
 		}
 		
@@ -102,7 +93,7 @@ package org.apache.flex.core
 		{
 			if (super.y != value) {
 				super.y = value;
-				dispatchEvent(new org.apache.flex.events.Event("yChanged"));
+				dispatchEvent(new Event("yChanged"));
 			}
 		}
 		
@@ -149,7 +140,7 @@ package org.apache.flex.core
 			
 			_explicitWidth = value;
 			
-			dispatchEvent(new org.apache.flex.events.Event("explicitWidthChanged"));
+			dispatchEvent(new Event("explicitWidthChanged"));
 		}
 		
 		private var _explicitHeight:Number;
@@ -182,7 +173,7 @@ package org.apache.flex.core
 			
 			_explicitHeight = value;
 			
-			dispatchEvent(new org.apache.flex.events.Event("explicitHeightChanged"));
+			dispatchEvent(new Event("explicitHeightChanged"));
 		}
 		
 		private var _percentWidth:Number;
@@ -217,7 +208,7 @@ package org.apache.flex.core
 			
 			_percentWidth = value;
 			
-			dispatchEvent(new org.apache.flex.events.Event("percentWidthChanged"));
+			dispatchEvent(new Event("percentWidthChanged"));
 		}
 		
 		private var _percentHeight:Number;
@@ -252,7 +243,7 @@ package org.apache.flex.core
 			
 			_percentHeight = value;
 			
-			dispatchEvent(new org.apache.flex.events.Event("percentHeightChanged"));
+			dispatchEvent(new Event("percentHeightChanged"));
 		}
 		
 		private var _width:Number;
@@ -295,7 +286,7 @@ package org.apache.flex.core
 			if (_width != value)
 			{
 				_width = value;
-				dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+				dispatchEvent(new Event("widthChanged"));
 			}
 		}
 
@@ -353,7 +344,7 @@ package org.apache.flex.core
 			if (_height != value)
 			{
 				_height = value;
-				dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+				dispatchEvent(new Event("heightChanged"));
 			}
 		}
         
@@ -385,7 +376,7 @@ package org.apache.flex.core
             {
                 _height = value;
                 if (!noEvent)
-                    dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+                    dispatchEvent(new Event("heightChanged"));
             }            
         }
         
@@ -403,7 +394,7 @@ package org.apache.flex.core
             {
                 _width = value;
                 if (!noEvent)
-                    dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+                    dispatchEvent(new Event("widthChanged"));
             }
         }
         
@@ -422,15 +413,15 @@ package org.apache.flex.core
                 _width = newWidth;
                 if (_height == newHeight)
                     if (!noEvent) 
-                        dispatchEvent(new org.apache.flex.events.Event("widthChanged"));
+                        dispatchEvent(new Event("widthChanged"));
             }
             if (_height != newHeight)
             {
                 _height = newHeight;
                 if (!noEvent)
-                    dispatchEvent(new org.apache.flex.events.Event("heightChanged"));
+                    dispatchEvent(new Event("heightChanged"));
             }            
-            dispatchEvent(new org.apache.flex.events.Event("sizeChanged"));
+            dispatchEvent(new Event("sizeChanged"));
         }
         
         /**
@@ -487,7 +478,7 @@ package org.apache.flex.core
             if (_model != value)
             {
                 addBead(value as IBead);
-                dispatchEvent(new org.apache.flex.events.Event("modelChanged"));
+                dispatchEvent(new Event("modelChanged"));
             }
         }
 		
@@ -523,7 +514,7 @@ package org.apache.flex.core
             if (_view != value)
             {
                 addBead(value as IBead);
-                dispatchEvent(new org.apache.flex.events.Event("viewChanged"));
+                dispatchEvent(new Event("viewChanged"));
             }
         }
         
@@ -550,7 +541,7 @@ package org.apache.flex.core
 			if (_id != value)
 			{
 				_id = value;
-				dispatchEvent(new org.apache.flex.events.Event("idChanged"));
+				dispatchEvent(new Event("idChanged"));
 			}
 		}
 
@@ -582,7 +573,7 @@ package org.apache.flex.core
                 _styles = ValuesManager.valuesImpl.parseStyles(value as String);
             else
                 _styles = value;
-            dispatchEvent(new org.apache.flex.events.Event("stylesChanged"));
+            dispatchEvent(new Event("stylesChanged"));
         }
         
         /**
@@ -626,7 +617,7 @@ package org.apache.flex.core
 			if (_className != value)
 			{
 				_className = value;
-				dispatchEvent(new org.apache.flex.events.Event("classNameChanged"));
+				dispatchEvent(new Event("classNameChanged"));
 			}
 		}
         
@@ -760,7 +751,7 @@ package org.apache.flex.core
                 }
             }
 
-            dispatchEvent(new org.apache.flex.events.Event("beadsAdded"));
+            dispatchEvent(new Event("beadsAdded"));
             
 		}
 		

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2ffcde11/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as
index d627fc0..3c48870 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/MouseEvent.as
@@ -43,30 +43,7 @@ package org.apache.flex.events
 		public static const ROLL_OUT:String = "rollOut";
         public static const CLICK:String = "click";
 
-        public static const UNCONVERTED_EVENTS:Object = { mouseWheel: 1 };
-        
-        /**
-         *  A method used to copy properties from flash.events.MouseEvent to 
-         *  org.apache.flex.events.Event.  The set of properties can be
-         *  different based on platform and runtime.
-         */
-        public static var convert:Function = flashConvert;
-        
-        private static function flashConvert(event:flash.events.MouseEvent):org.apache.flex.events.MouseEvent
-        {
-            if (UNCONVERTED_EVENTS[event.type])
-                return null;
-            
-            var newEvent:org.apache.flex.events.MouseEvent = 
-                  new org.apache.flex.events.MouseEvent(event.type, event.bubbles, event.cancelable,
-                                                        event.localX, event.localY, event.relatedObject,
-                                                        event.ctrlKey, event.altKey, event.shiftKey,
-                                                        event.buttonDown, event.delta);
-
-            return newEvent;
-        }
-        
-        /**
+         /**
          *  Constructor.
          *  
          *  @param type The name of the event.

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2ffcde11/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseEventConverter.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseEventConverter.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseEventConverter.as
new file mode 100644
index 0000000..8556c39
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/events/utils/MouseEventConverter.as
@@ -0,0 +1,165 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.events.utils
+{	
+    import flash.events.Event;
+    import flash.events.IEventDispatcher;
+    import flash.events.MouseEvent;
+    
+    import org.apache.flex.events.MouseEvent;
+    
+	/**
+	 *  Mouse events conversion.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+	 */
+	public class MouseEventConverter
+	{
+        /**
+         *  A map of events that are not converted, because there is no
+         *  JS equivalent.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static const UNCONVERTED_EVENTS:Object = { mouseWheel: 1 };
+        
+        /**
+         *  A method used to copy properties from flash.events.MouseEvent to 
+         *  org.apache.flex.events.Event.  The set of properties can be
+         *  different based on platform and runtime.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var convert:Function = flashConvert;
+        
+        private static function flashConvert(event:flash.events.MouseEvent):org.apache.flex.events.MouseEvent
+        {
+            if (UNCONVERTED_EVENTS[event.type])
+                return null;
+            
+            var newEvent:org.apache.flex.events.MouseEvent = 
+                  new org.apache.flex.events.MouseEvent(event.type, event.bubbles, event.cancelable,
+                                                        event.localX, event.localY, event.relatedObject,
+                                                        event.ctrlKey, event.altKey, event.shiftKey,
+                                                        event.buttonDown, event.delta);
+
+            return newEvent;
+        }
+        
+        private static function mouseEventConverter(event:flash.events.Event):void
+        {
+            if (event is flash.events.MouseEvent && (!(event is org.apache.flex.events.MouseEvent)))
+            {
+                var newEvent:org.apache.flex.events.MouseEvent = 
+                    convert(flash.events.MouseEvent(event));
+                if (newEvent) 
+                {
+                    // some events are not converted if there are no JS equivalents
+                    event.stopImmediatePropagation();
+                    event.target.dispatchEvent(newEvent);
+                }
+                else
+                    trace("did not convert", event.type);
+            }
+        }
+        
+        /**
+         *  The list of events to convert.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var allConvertedEvents:Array = [
+            flash.events.MouseEvent.CLICK,
+            flash.events.MouseEvent.MOUSE_DOWN,
+            flash.events.MouseEvent.MOUSE_UP,
+            flash.events.MouseEvent.ROLL_OVER,
+            flash.events.MouseEvent.ROLL_OUT,
+            flash.events.MouseEvent.MOUSE_OVER,
+            flash.events.MouseEvent.MOUSE_OUT,
+            flash.events.MouseEvent.MOUSE_MOVE
+            ];
+            
+        /**
+         *  The list of events to convert on each instance.
+         *  Per-instance killers are needed for "out" events because
+         *  they can be sent after the instance is removed from the 
+         *  display list so the main converter can't intercept them
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var perInstanceConvertedEvents:Array = [
+            flash.events.MouseEvent.MOUSE_UP,
+            flash.events.MouseEvent.ROLL_OUT,
+            flash.events.MouseEvent.MOUSE_OUT
+        ];
+        
+        /**
+         *  The event handler that converts the events.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static var eventHandler:Function = mouseEventConverter;
+        
+        /**
+         *  Set up the top level converter.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function setupAllConverters(target:IEventDispatcher):void
+        {
+            for each (var eventType:String in allConvertedEvents)
+                target.addEventListener(eventType, eventHandler, true, 9999);
+        }
+
+        /**
+         *  Set up some event handlers on each instance.
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static function setupInstanceConverters(target:IEventDispatcher):void
+        {
+            for each (var eventType:String in perInstanceConvertedEvents)
+                target.addEventListener(eventType, eventHandler, false, 9999);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2ffcde11/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
index 602a4e6..f349803 100644
--- a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/html/supportClasses/TextFieldItemRenderer.as
@@ -28,6 +28,8 @@ package org.apache.flex.html.supportClasses
     import org.apache.flex.core.UIBase;
     import org.apache.flex.core.ValuesManager;
     import org.apache.flex.events.Event;
+    import org.apache.flex.events.MouseEvent;
+    import org.apache.flex.events.utils.MouseEventConverter;
     import org.apache.flex.html.beads.ITextItemRenderer;
 	
 	/**
@@ -53,8 +55,10 @@ package org.apache.flex.html.supportClasses
 			super();
             type = TextFieldType.DYNAMIC;
             selectable = false;
+            
+            MouseEventConverter.setupInstanceConverters(this);
 		}
-        
+                
         public var highlightColor:uint = 0xCEDBEF;
         public var selectedColor:uint = 0xA8C6EE;
         public var downColor:uint = 0x808080;
@@ -337,7 +341,7 @@ package org.apache.flex.html.supportClasses
             for each (var bead:IBead in beads)
                 addBead(bead);
             
-            dispatchEvent(new org.apache.flex.events.Event("beadsAdded"));
+            dispatchEvent(new Event("beadsAdded"));
 
             // renderer has a default model (the 'data' property)
             // and it is essentially a view of that model, so it


Mime
View raw message