[Laszlo-checkins] r13443 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9

bargull@openlaszlo.org bargull at openlaszlo.org
Tue Mar 24 03:58:00 PDT 2009


Author: bargull
Date: 2009-03-24 03:57:57 -0700 (Tue, 24 Mar 2009)
New Revision: 13443

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
Log:
Change 20090324-bargull-Gvd by bargull at dell--p4--2-53 on 2009-03-24 00:33:06
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: make lfc compile again for swf9

New Features:

Bugs Fixed: LPP-7912 (SWF9: support for default cursors)

Technical Reviewer: hminsky
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Only use flash.ui.Mouse.cursor and flash.ui.MouseCursor for swf10
    

Tests:
change flex-config to set target-player to 9
recompile lfc for swf9
note: you cannot test the changes properly because of LPP-7970



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as	2009-03-24 04:28:03 UTC (rev 13442)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzMouseKernel.as	2009-03-24 10:57:57 UTC (rev 13443)
@@ -15,8 +15,8 @@
     import flash.events.Event;
     import flash.events.MouseEvent;
     import flash.text.TextField;
-    import flash.ui.Mouse;
-    import flash.ui.MouseCursor;
+    import flash.ui.*;
+    import flash.utils.getDefinitionByName;
     }#
 
 
@@ -114,15 +114,25 @@
     static var lastCursorResource:String = null;
 
     #passthrough {
+        private static var __MouseCursor:Object = null;
+        private static function get MouseCursor () :Object {
+            if (__MouseCursor == null) {
+                __MouseCursor = getDefinitionByName('flash.ui.MouseCursor');
+            }
+            return __MouseCursor;
+        }
+
         private static var __builtinCursors:Object = null;
         static function get builtinCursors () :Object {
             if (__builtinCursors == null) {
                 var cursors:Object = {};
-                cursors[MouseCursor.ARROW] = true;
-                cursors[MouseCursor.AUTO] = true;
-                cursors[MouseCursor.BUTTON] = true;
-                cursors[MouseCursor.HAND] = true;
-                cursors[MouseCursor.IBEAM] = true;
+                if ($swf10) {
+                    cursors[MouseCursor.ARROW] = true;
+                    cursors[MouseCursor.AUTO] = true;
+                    cursors[MouseCursor.BUTTON] = true;
+                    cursors[MouseCursor.HAND] = true;
+                    cursors[MouseCursor.IBEAM] = true;
+                }
                 __builtinCursors = cursors;
             }
             return __builtinCursors;
@@ -130,7 +140,11 @@
 
         static function get hasGlobalCursor () :Boolean {
             var gcursor:String = globalCursorResource;
-            return ! (gcursor == null || (gcursor == MouseCursor.AUTO && useBuiltinCursor));
+            if ($swf10) {
+                return ! (gcursor == null || (gcursor == MouseCursor.AUTO && useBuiltinCursor));
+            } else {
+                return ! (gcursor == null);
+            }
         }
     }#
 
@@ -165,7 +179,7 @@
             lastCursorResource = what;
         }
         if (useBuiltinCursor) {
-            Mouse.cursor = what;
+            if ($swf10) { Mouse['cursor'] = what; }
             cursorSprite.stopDrag();
             cursorSprite.visible = false;
             LFCApplication.stage.removeEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler);
@@ -173,7 +187,7 @@
             Mouse.show();
         } else {
             // you can only hide the Mouse when Mouse.cursor is AUTO
-            Mouse.cursor = MouseCursor.AUTO;
+            if ($swf10) { Mouse['cursor'] = MouseCursor.AUTO; }
             Mouse.hide();
             cursorSprite.x = LFCApplication.stage.mouseX;
             cursorSprite.y = LFCApplication.stage.mouseY;
@@ -258,7 +272,7 @@
         LFCApplication.stage.removeEventListener(Event.MOUSE_LEAVE, mouseLeaveHandler);
         LFCApplication.stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
         globalCursorResource = null;
-        Mouse.cursor = MouseCursor.AUTO;
+        if ($swf10) { Mouse['cursor'] = MouseCursor.AUTO; }
         Mouse.show();
     }
 

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as	2009-03-24 04:28:03 UTC (rev 13442)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as	2009-03-24 10:57:57 UTC (rev 13443)
@@ -27,7 +27,8 @@
         import flash.text.TextFieldAutoSize;
         import flash.text.TextFormat;
         import flash.text.TextLineMetrics;
-        import flash.ui.MouseCursor;
+        import flash.ui.*;
+        import flash.utils.getDefinitionByName;
     }#
 
         #passthrough  {
@@ -177,7 +178,7 @@
                             if (sprite.buttonMode && sprite.useHandCursor) {
                                 // need to respect global cursor setting
                                 if (! LzMouseKernel.hasGlobalCursor) {
-                                    cursor = MouseCursor.BUTTON;
+                                    if ($swf10) { cursor = MouseCursor.BUTTON; }
                                 }
                             }
                             if (sprite is LzSprite) {
@@ -209,6 +210,14 @@
             }
         }
 
+        private static var __MouseCursor:Object = null;
+        private static function get MouseCursor () :Object {
+            if (__MouseCursor == null) {
+                __MouseCursor = getDefinitionByName('flash.ui.MouseCursor');
+            }
+            return __MouseCursor;
+        }
+
         function get forwardsMouse () :Boolean {
             return ! (this.clickable || this.textfield.selectable);
         }



More information about the Laszlo-checkins mailing list