also cross-compile SimpleApplication

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

Branch: refs/heads/develop
Commit: 0f23c52ce23fc341ba0026eb0ab5c2ad8e9398e9
Parents: 13880a6
Author: Alex Harui <[email protected]>
Authored: Mon Jan 11 08:40:11 2016 -0800
Committer: Alex Harui <[email protected]>
Committed: Mon Jan 11 10:06:14 2016 -0800

----------------------------------------------------------------------
 frameworks/projects/Core/as/src/CoreClasses.as  |  5 +---
 .../org/apache/flex/core/SimpleApplication.as   | 31 ++++++++++++++------
 2 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f23c52c/frameworks/projects/Core/as/src/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/CoreClasses.as 
b/frameworks/projects/Core/as/src/CoreClasses.as
index 0c1c536..d43ea81 100644
--- a/frameworks/projects/Core/as/src/CoreClasses.as
+++ b/frameworks/projects/Core/as/src/CoreClasses.as
@@ -90,10 +90,7 @@ internal class CoreClasses
        import org.apache.flex.core.ListBase; ListBase;
        import org.apache.flex.core.ListBaseStrandChildren; 
ListBaseStrandChildren;
     import org.apache.flex.core.SimpleStatesImpl; SimpleStatesImpl;
-       COMPILE::AS3
-       {
-           import org.apache.flex.core.SimpleApplication; SimpleApplication;
-       }
+    import org.apache.flex.core.SimpleApplication; SimpleApplication;
     import org.apache.flex.core.DataBindingBase; DataBindingBase;
     import org.apache.flex.core.UIBase; UIBase;
        COMPILE::AS3

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f23c52c/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as 
b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
index 434b0b1..5d4d918 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
@@ -18,6 +18,8 @@
 
////////////////////////////////////////////////////////////////////////////////
 package org.apache.flex.core
 {
+       COMPILE::AS3
+       {
     import flash.display.DisplayObject;
     import flash.display.Sprite;
     import flash.display.StageAlign;
@@ -26,7 +28,8 @@ package org.apache.flex.core
     import flash.events.Event;
     import flash.system.ApplicationDomain;
     import flash.utils.getQualifiedClassName;
-    
+       }
+       
     import org.apache.flex.events.Event;
     import org.apache.flex.events.IEventDispatcher;
     import org.apache.flex.events.MouseEvent;
@@ -45,7 +48,7 @@ package org.apache.flex.core
      *  @playerversion AIR 2.6
      *  @productversion FlexJS 0.0
      */
-    public class SimpleApplication extends Sprite
+    public class SimpleApplication extends ApplicationBase
     {
         /**
          *  Constructor.
@@ -58,17 +61,21 @@ package org.apache.flex.core
         public function SimpleApplication()
         {
             super();
-                       if (stage)
+                       COMPILE::AS3
                        {
-                               stage.align = StageAlign.TOP_LEFT;
-                               stage.scaleMode = StageScaleMode.NO_SCALE;
-                // should be opt-in
-                               //stage.quality = 
StageQuality.HIGH_16X16_LINEAR;                
+                               if (stage)
+                               {
+                                       stage.align = StageAlign.TOP_LEFT;
+                                       stage.scaleMode = 
StageScaleMode.NO_SCALE;
+                                       // should be opt-in
+                                       //stage.quality = 
StageQuality.HIGH_16X16_LINEAR;                
+                               }
+                               
+                               
loaderInfo.addEventListener(flash.events.Event.INIT, initHandler);
                        }
-                       
-            loaderInfo.addEventListener(flash.events.Event.INIT, initHandler);
         }
         
+               COMPILE::AS3
         private function initHandler(event:flash.events.Event):void
         {
                        start();
@@ -84,6 +91,12 @@ package org.apache.flex.core
          */
                public function start():void
                {
+                 COMPILE::JS
+                 {
+                         this.element = 
document.getElementsByTagName('body')[0];
+                         this.element.flexjs_wrapper = this;
+                         this.element.className = 'SimpleApplication';
+                 }
                }
        }
 }
\ No newline at end of file

Reply via email to