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:47:40 UTC

[05/50] git commit: [flex-asjs] [refs/heads/tlf] - Created AirApplication the adds a single frame delay so Air applications will get the correct stage size.

Created AirApplication the adds a single frame delay so Air applications will get the correct stage size.


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

Branch: refs/heads/tlf
Commit: 6ccc02585b1adcba5cf0053531f907b216ba3ddb
Parents: 1e450bb
Author: Peter Ent <pe...@apache.org>
Authored: Tue May 23 14:25:39 2017 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Tue May 23 14:25:39 2017 -0400

----------------------------------------------------------------------
 .../flex/org/apache/flex/core/AirApplication.as | 115 +++++++++++++++++++
 .../Basic/src/main/resources/basic-manifest.xml |   1 +
 2 files changed, 116 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6ccc0258/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/AirApplication.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/AirApplication.as b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/AirApplication.as
new file mode 100644
index 0000000..51058b2
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/flex/org/apache/flex/core/AirApplication.as
@@ -0,0 +1,115 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.core
+{
+    import org.apache.flex.events.Event;
+    import org.apache.flex.events.IEventDispatcher;
+
+    //--------------------------------------
+    //  Events
+    //--------------------------------------
+
+    /**
+     *  Dispatched at startup. Attributes and sub-instances of
+     *  the MXML document have been created and assigned.
+     *  The component lifecycle is different
+     *  than the Flex SDK.  There is no creationComplete event.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="initialize", type="org.apache.flex.events.Event")]
+
+    /**
+     *  Dispatched at startup before the instances get created.
+     *  Beads can call preventDefault and defer initialization.
+     *  This event will be dispatched on every frame until no
+     *  listeners call preventDefault(), then the initialize()
+     *  method will be called.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="preinitialize", type="org.apache.flex.events.Event")]
+
+    /**
+     *  Dispatched at startup after the initial view has been
+     *  put on the display list. This event is sent before
+     *  applicationComplete is dispatched.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="viewChanged", type="org.apache.flex.events.Event")]
+
+    /**
+     *  Dispatched at startup after the initial view has been
+     *  put on the display list.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.0
+     */
+    [Event(name="applicationComplete", type="org.apache.flex.events.Event")]
+    
+    /**
+     *  The AirApplication class should be used by Air applications as their
+	 *  main entry point.
+     *
+     *  @see Application
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion FlexJS 0.8
+     */
+    public class AirApplication extends Application
+    {
+        /**
+         *  Constructor.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public function AirApplication()
+        {
+			COMPILE::SWF {
+				addEventListener("preinitialize", handlePreInitialize);
+			}
+				
+            super();
+        }
+		
+		COMPILE::SWF
+		private function handlePreInitialize(event:org.apache.flex.events.Event):void
+		{
+			event.preventDefault();
+			removeEventListener("preinitialize", handlePreInitialize);
+		}
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6ccc0258/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Basic/src/main/resources/basic-manifest.xml b/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
index 09bb1a3..bc5dca3 100644
--- a/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
@@ -22,6 +22,7 @@
 <componentPackage>
 
     <component id="Application" class="org.apache.flex.core.Application"/>
+    <component id="AirApplication" class="org.apache.flex.core.AirApplication"/>
     <component id="View" class="org.apache.flex.core.View"/>
     <component id="Button" class="org.apache.flex.html.Button"/>
     <component id="CloseButton" class="org.apache.flex.html.CloseButton"/>