You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/05/30 19:48:14 UTC

[39/50] git commit: [flex-asjs] [refs/heads/tlf] - have to handle type-checking differently now that SWF event is based on flash.events.Event

have to handle type-checking differently now that SWF event is based on 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/1a390803
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/1a390803
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/1a390803

Branch: refs/heads/tlf
Commit: 1a390803bbfec7e944b3c4333743cc8b75f356ed
Parents: bf404b1
Author: Alex Harui <ah...@apache.org>
Authored: Tue May 30 11:31:06 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 30 11:31:06 2017 -0700

----------------------------------------------------------------------
 .../beads/DispatchTLFKeyboardEventBead.as       | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1a390803/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as
index 495532c..c308f9d 100644
--- a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as
@@ -126,12 +126,15 @@ package org.apache.flex.textLayout.beads
 		 * @private
 		 */
 		COMPILE::SWF
-		protected function textEventHandler(event:flash.events.TextEvent):void
+		protected function textEventHandler(event:flash.events.Event):void
 		{
+			if (event is org.apache.flex.events.Event) return;
+
 			// this will otherwise bubble an event of flash.events.Event
 			event.stopImmediatePropagation();
-			var newEvent:org.apache.flex.text.events.TextEvent = new org.apache.flex.text.events.TextEvent(event.type);
-			newEvent.text = event.text;
+			var textEvent:flash.events.TextEvent = event as flash.events.TextEvent;
+			var newEvent:org.apache.flex.text.events.TextEvent = new org.apache.flex.text.events.TextEvent(textEvent.type);
+			newEvent.text = textEvent.text;
 			(_strand as IEventDispatcher).dispatchEvent(newEvent);
 			if(newEvent.defaultPrevented)
 			{
@@ -145,11 +148,14 @@ package org.apache.flex.textLayout.beads
 		 * @private
 		 */
 		COMPILE::SWF
-		protected function keyEventHandler(event:flash.events.KeyboardEvent):void
+		protected function keyEventHandler(event:flash.events.Event):void
 		{
+			if (event is org.apache.flex.events.Event) return;
+			
 			// this will otherwise bubble an event of flash.events.Event
 			event.stopImmediatePropagation();
-			var newEvent:org.apache.flex.events.KeyboardEvent = KeyboardEventConverter.convert(event);
+			var keyEvent:flash.events.KeyboardEvent = event as flash.events.KeyboardEvent;
+			var newEvent:org.apache.flex.events.KeyboardEvent = KeyboardEventConverter.convert(keyEvent);
 			(_strand as IEventDispatcher).dispatchEvent(newEvent);
 			if(newEvent.defaultPrevented)
 			{
@@ -181,13 +187,13 @@ package org.apache.flex.textLayout.beads
 		 * @private
 		 */
 		COMPILE::SWF
-		protected function focusEventHandler(event:flash.events.FocusEvent):void
+		protected function focusEventHandler(event:flash.events.Event):void
 		{
 			if (event is org.apache.flex.events.Event) return;
 			
-			trace(event.type, event.target, event.relatedObject);
 			// this will otherwise dispatch an event of flash.events.FocusEvent
 			event.stopImmediatePropagation();
+			var focusEvent:flash.events.FocusEvent = event as flash.events.FocusEvent;
 			var newEvent:org.apache.flex.textLayout.events.FocusEvent = new org.apache.flex.textLayout.events.FocusEvent(event.type);
 			(_strand as IEventDispatcher).dispatchEvent(newEvent);
 			if(newEvent.defaultPrevented)