flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Modified the frameworks CreateJS project to run the effects on the SWF side.
Date Mon, 25 Jul 2016 19:44:39 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop afd88a11f -> 1e67bacde


Modified the frameworks CreateJS project to run the effects on the SWF side.


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

Branch: refs/heads/develop
Commit: 1e67bacded6aa2cd6b8258f7e33bf256a696ed1f
Parents: afd88a1
Author: Peter Ent <pent@apache.org>
Authored: Mon Jul 25 15:44:35 2016 -0400
Committer: Peter Ent <pent@apache.org>
Committed: Mon Jul 25 15:44:35 2016 -0400

----------------------------------------------------------------------
 frameworks/build.xml                            |  4 +-
 .../src/main/config/compile-as-config.xml       |  1 +
 .../org/apache/flex/createjs/tween/Sequence.as  | 52 ++++++++++++++++++++
 .../org/apache/flex/createjs/tween/Tween.as     | 45 ++++++++++++++++-
 .../CreateJS/src/main/resources/defaults.css    |  6 +++
 5 files changed, 105 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e67bacd/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index 2acfddc..e849d3f 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -84,11 +84,11 @@
         <antcall target="HTML"/>
         <antcall target="Flat"/>
         <antcall target="Charts"/>
-        <antcall target="CreateJS"/>
         <antcall target="DragDrop"/>
         <antcall target="Effects"/>
         <antcall target="Formatters"/>
         <antcall target="GoogleMaps"/>
+        <antcall target="CreateJS"/>
         <antcall target="HTML5"/>
         <antcall target="JQuery"/>
         <antcall target="Mobile"/>
@@ -126,12 +126,12 @@
         <ant dir="${basedir}/projects/Charts" target="clean"/>
         <ant dir="${basedir}/projects/Collections" target="clean"/>
         <ant dir="${basedir}/projects/Core" target="clean"/>
-        <ant dir="${basedir}/projects/CreateJS" target="clean"/>
         <ant dir="${basedir}/projects/DragDrop" target="clean"/>
         <ant dir="${basedir}/projects/Effects" target="clean"/>
         <ant dir="${basedir}/projects/Flat" target="clean"/>
         <ant dir="${basedir}/projects/Formatters" target="clean"/>
         <ant dir="${basedir}/projects/GoogleMaps" target="clean"/>
+        <ant dir="${basedir}/projects/CreateJS" target="clean"/>
         <ant dir="${basedir}/projects/Graphics" target="clean"/>
         <ant dir="${basedir}/projects/HTML" target="clean"/>
         <ant dir="${basedir}/projects/HTML5" target="clean"/>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e67bacd/frameworks/projects/CreateJS/src/main/config/compile-as-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/CreateJS/src/main/config/compile-as-config.xml b/frameworks/projects/CreateJS/src/main/config/compile-as-config.xml
index acc5ddb..5862e1b 100644
--- a/frameworks/projects/CreateJS/src/main/config/compile-as-config.xml
+++ b/frameworks/projects/CreateJS/src/main/config/compile-as-config.xml
@@ -26,6 +26,7 @@
             <path-element>../../../../../libs/Core.swc</path-element>
             <path-element>../../../../../libs/HTML.swc</path-element>
             <path-element>../../../../../libs/Graphics.swc</path-element>
+            <path-element>../../../../../libs/Effects.swc</path-element>
         </external-library-path>
         
 		<mxml>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e67bacd/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Sequence.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Sequence.as
b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Sequence.as
index 5645864..6d09ed4 100644
--- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Sequence.as
+++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Sequence.as
@@ -28,6 +28,16 @@ package org.apache.flex.createjs.tween
 		import createjs.Ticker;
 	}
 		
+	COMPILE::SWF {
+		import org.apache.flex.core.IUIBase;
+		import org.apache.flex.events.Event;
+		import org.apache.flex.effects.IEffect;
+		import org.apache.flex.effects.Sequence;
+		import org.apache.flex.effects.Parallel;
+		import org.apache.flex.effects.Fade;
+		import org.apache.flex.effects.Move;
+	}
+		
 	[DefaultProperty("tweens")]
 		
     /**
@@ -53,6 +63,10 @@ package org.apache.flex.createjs.tween
 			super(target);
 			
 			_tweens = [];
+			
+			COMPILE::SWF {
+				_sequence = new org.apache.flex.effects.Sequence();
+			}
 		}
 		
 		private var _tweens:Array;
@@ -60,6 +74,8 @@ package org.apache.flex.createjs.tween
 		public function set tweens(value:Array):void
 		{
 			_tweens = value;
+			
+			
 		}
 		public function get tweens():Array
 		{
@@ -74,6 +90,15 @@ package org.apache.flex.createjs.tween
 		COMPILE::JS
 		private var _tween:createjs.Tween;
 		
+		COMPILE::SWF
+		private var _sequence:org.apache.flex.effects.Sequence;
+		
+		COMPILE::SWF
+		public function internalEffect():IEffect
+		{
+			return _sequence;
+		}
+		
 		/**
 		 *  @private
 		 *  The document.
@@ -83,6 +108,17 @@ package org.apache.flex.createjs.tween
 		public function setDocument(document:Object, id:String = null):void
 		{
 			this.document = document;	
+			
+			COMPILE::SWF {
+				_sequence.setDocument(document);
+
+				for (var i:int=0; i < _tweens.length; i++) {
+					var tween:Tween = _tweens[i];
+					var para:IEffect = tween.internalEffect();
+					
+					_sequence.addChild(para);
+				}
+			}
 		}
 		
 		/**
@@ -119,6 +155,22 @@ package org.apache.flex.createjs.tween
 				var stage:createjs.Stage = element.getStage();
 				createjs.Ticker.addEventListener("tick", stage);
 			}
+				
+			COMPILE::SWF {
+				_sequence.addEventListener("effectEnd", effectEndHandler);
+				_sequence.play();
+			}
+		}
+		
+		/**
+		 * @private
+		 */
+		COMPILE::SWF
+		private function effectEndHandler(event:Event):void
+		{
+			if (loop) {
+				_sequence.play();
+			}
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e67bacd/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Tween.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Tween.as
b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Tween.as
index d21275f..29b8eba 100644
--- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Tween.as
+++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Tween.as
@@ -28,6 +28,13 @@ package org.apache.flex.createjs.tween
 		import createjs.Ticker;
 	}
 		
+	COMPILE::SWF {
+		import org.apache.flex.effects.IEffect;
+		import org.apache.flex.effects.Parallel;
+		import org.apache.flex.effects.Fade;
+		import org.apache.flex.effects.Move;
+	}
+		
     /**
      * The Tween effect animates an object from one place to another; it can also
 	 * fade and object in and out by adjusting the object's alpha value. Once the
@@ -53,6 +60,10 @@ package org.apache.flex.createjs.tween
         public function Tween(target:Object=null)
 		{
 			super(target);
+			
+			COMPILE::SWF {
+				_parallel = new Parallel();
+			}
 		}
 		
 		/**
@@ -123,13 +134,42 @@ package org.apache.flex.createjs.tween
 		
 		public function setDocument(document:Object, id:String = null):void
 		{
-			this.document = document;	
+			this.document = document;
+			
+			COMPILE::SWF {
+				var move:Move = new Move();
+				move.setDocument(document);
+				move.target = this.target;
+				move.xFrom = this.xFrom;
+				move.xTo = this.xTo;
+				move.yFrom = this.yFrom;
+				move.yTo = this.yTo;
+				
+				var fade:Fade = new Fade();
+				fade.setDocument(document);
+				fade.target = this.target;
+				fade.alphaFrom = this.alphaFrom;
+				fade.alphaTo = this.alphaTo;
+				
+				_parallel.setDocument(document);
+				_parallel.addChild(move);
+				_parallel.addChild(fade);
+			}
 		}
 		
 		
 		COMPILE::JS
 		private var _tween:createjs.Tween;
 		
+		COMPILE::SWF
+		private var _parallel:Parallel;
+		
+		COMPILE::SWF
+		public function internalEffect():IEffect
+		{
+			return _parallel;
+		}
+		
 		/**
 		 * @private
 		 * @flexjsignorecoercion createjs.Shape
@@ -189,6 +229,9 @@ package org.apache.flex.createjs.tween
 				var stage:createjs.Stage = element.getStage();
 				createjs.Ticker.addEventListener("tick", stage);
 			}
+			COMPILE::SWF {
+				_parallel.play();
+			}
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1e67bacd/frameworks/projects/CreateJS/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/CreateJS/src/main/resources/defaults.css b/frameworks/projects/CreateJS/src/main/resources/defaults.css
index db5cfa7..7883ff0 100644
--- a/frameworks/projects/CreateJS/src/main/resources/defaults.css
+++ b/frameworks/projects/CreateJS/src/main/resources/defaults.css
@@ -19,6 +19,12 @@
 
 @namespace createjs "library://ns.apache.org/flexjs/createjs";
 
+global
+{
+	IEffectTimer: ClassReference("org.apache.flex.utils.EffectTimer");
+	effectTimerInterval: 10;
+}
+
 createjs|TextButton
 {
 	IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");


Mime
View raw message