Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 540CA19681 for ; Wed, 27 Apr 2016 07:42:22 +0000 (UTC) Received: (qmail 50675 invoked by uid 500); 27 Apr 2016 07:42:22 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 50649 invoked by uid 500); 27 Apr 2016 07:42:22 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 50640 invoked by uid 99); 27 Apr 2016 07:42:22 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Apr 2016 07:42:22 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 23A85DFDE3; Wed, 27 Apr 2016 07:42:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cdutz@apache.org To: commits@flex.apache.org Date: Wed, 27 Apr 2016 07:42:22 -0000 Message-Id: <8383f0cdeb234c3b80697bcad459946a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/5] git commit: [flex-asjs] [refs/heads/feature/maven-migration] - Added Move effect to CreateJS framework and example. Repository: flex-asjs Updated Branches: refs/heads/feature/maven-migration 087dd8248 -> 9dbcb5d14 Added Move effect to CreateJS framework and example. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/8cb2031a Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/8cb2031a Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/8cb2031a Branch: refs/heads/feature/maven-migration Commit: 8cb2031ac069c57715dd48e0409038a497d87d11 Parents: 9a52f49 Author: Peter Ent Authored: Mon Apr 25 15:27:12 2016 -0400 Committer: Peter Ent Committed: Mon Apr 25 15:27:12 2016 -0400 ---------------------------------------------------------------------- .../CreateJSExample/src/CreateJSExample.mxml | 16 +- .../CreateJS/src/main/flex/CreateJSClasses.as | 1 + .../org/apache/flex/createjs/Application.as | 3 + .../apache/flex/createjs/core/CreateJSBase.as | 5 + .../flex/org/apache/flex/createjs/tween/Move.as | 149 +++++++++++++++++++ .../src/main/resources/createjs-manifest.xml | 1 + 6 files changed, 174 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8cb2031a/examples/flexjs/CreateJSExample/src/CreateJSExample.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/CreateJSExample/src/CreateJSExample.mxml b/examples/flexjs/CreateJSExample/src/CreateJSExample.mxml index f7c8768..a2a678c 100644 --- a/examples/flexjs/CreateJSExample/src/CreateJSExample.mxml +++ b/examples/flexjs/CreateJSExample/src/CreateJSExample.mxml @@ -21,16 +21,30 @@ limitations under the License. xmlns:local="*" xmlns:js="library://ns.apache.org/flexjs/basic" xmlns:cjs="library://ns.apache.org/flexjs/createjs" + applicationComplete="runEffect()" > + + + + - + http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8cb2031a/frameworks/projects/CreateJS/src/main/flex/CreateJSClasses.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/CreateJSClasses.as b/frameworks/projects/CreateJS/src/main/flex/CreateJSClasses.as index 816c665..a39aaee 100644 --- a/frameworks/projects/CreateJS/src/main/flex/CreateJSClasses.as +++ b/frameworks/projects/CreateJS/src/main/flex/CreateJSClasses.as @@ -30,6 +30,7 @@ internal class CreateJSClasses import org.apache.flex.createjs.core.UIBase; UIBase; import org.apache.flex.createjs.core.View; View; import org.apache.flex.createjs.graphics.GraphicShape; GraphicShape; + import org.apache.flex.createjs.tween.Move; Move; } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8cb2031a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as index 46ca931..3ef4196 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Application.as @@ -123,6 +123,7 @@ package org.apache.flex.createjs * * * + * * */ public function Application() @@ -167,6 +168,8 @@ package org.apache.flex.createjs dispatchEvent('viewChanged'); stage.update(); + + dispatchEvent('applicationComplete'); } /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8cb2031a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as index d23359e..3f13292 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as @@ -33,6 +33,11 @@ package org.apache.flex.createjs.core import org.apache.flex.core.graphics.SolidColor; } + COMPILE::AS3 + { + import org.apache.flex.core.UIBase; + } + /** * This is the base class for CreateJS component wrappers used by FlexJS * applications. This class provides standard properties that most of the http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8cb2031a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Move.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Move.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Move.as new file mode 100644 index 0000000..4644ab1 --- /dev/null +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/tween/Move.as @@ -0,0 +1,149 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.createjs.tween +{ + import org.apache.flex.events.EventDispatcher; + + import org.apache.flex.createjs.core.CreateJSBase; + + COMPILE::JS { + import createjs.Tween; + import createjs.Stage; + import createjs.Ease; + import createjs.Ticker; + } + + /** + * The Move effect animates an object from one place to another. Once the + * target object is set, its starting position may be given (or its current + * location will be used) and an ending position given, the play() function + * is used to make the animation have effect. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public class Move extends EventDispatcher + { + /** + * Constructor + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public function Move(target:Object=null) + { + super(); + + actualTarget = target; + } + + + private var _actualTarget:Object; + + /** + * @private + * The actual target. + */ + public function get actualTarget():Object + { + return _actualTarget; + } + public function set actualTarget(value:Object):void + { + _actualTarget = value; + } + + + /** + * Starting x value. If NaN, the current x value is used + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public var xFrom:Number; + + /** + * Ending x value. If NaN, the current x value is not changed + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public var xTo:Number; + + /** + * Starting y value. If NaN, the current y value is used + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public var yFrom:Number; + + /** + * Ending y value. If NaN, the current y value is not changed + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public var yTo:Number; + + COMPILE::JS + private var tween:createjs.Tween; + + /** + * Causes the target object to move between its starting and ending positions. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + * @flexignorecoercion createjs.Shape + * @flexignorecoercion org.apache.flex.createjs.core.CreateJSBase + */ + public function play():void + { + COMPILE::JS { + var target:CreateJSBase = actualTarget as CreateJSBase; + var element:createjs.Shape = target.element as createjs.Shape; + tween = createjs.Tween.get(element, {loop: false}); + + var options:Object = {x:xTo, y:yTo}; + + if (!isNaN(xFrom)) target.x = xFrom; + if (!isNaN(yFrom)) target.y = yFrom; + + tween.to( options, 1000, createjs.Ease.getPowInOut(2)); + + var stage:createjs.Stage = element.getStage(); + createjs.Ticker.addEventListener("tick", stage); + } + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8cb2031a/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml b/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml index 5716695..ec1414f 100644 --- a/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml +++ b/frameworks/projects/CreateJS/src/main/resources/createjs-manifest.xml @@ -29,5 +29,6 @@ +