| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| 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. |
| |
| --> |
| |
| <s:Application |
| width="500" height="500" |
| xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:mx="library://ns.adobe.com/flex/mx" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:trix="Containers.*" |
| backgroundColor="0xFFFFFF"> |
| |
| <fx:Style> |
| @namespace s "library://ns.adobe.com/flex/spark"; |
| @namespace mx "library://ns.adobe.com/flex/mx"; |
| |
| |
| @font-face |
| { |
| src: url("../../../../../Assets/Fonts/Open_Sans/OpenSans-Regular.ttf"); |
| fontFamily: vera1; |
| embedAsCFF: false; |
| } |
| |
| global |
| { |
| fontFamily: vera1; |
| fontLookup: embeddedCFF; |
| color: blue; |
| } |
| |
| s|SkinnableComponent |
| { |
| fontFamily: vera1; |
| fontLookup: embeddedCFF; |
| color: black; |
| } |
| </fx:Style> |
| |
| <fx:Script> |
| <![CDATA[ |
| import mx.core.UIComponent; |
| import spark.effects.Animate; |
| import spark.effects.animation.*; |
| |
| //The global current test object |
| public var uiComponent:UIComponent = new UIComponent(); |
| |
| |
| public function ApplyEffect():void |
| { |
| this.testEffect.motionPaths = new Vector.<MotionPath>(); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("x", 0, 100, 500)); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("y", 0, 120, 500)); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("alpha", 1.0, 0.2, 500)); |
| |
| this.testEffect.target = this.uiComponent; |
| this.testEffect.playheadTime = 333; |
| this.testEffect.stop(); |
| } |
| |
| public function ApplyEffectToTarget(target:Object):void |
| { |
| this.testEffect.motionPaths = new Vector.<MotionPath>(); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("x", 0, 100, 500)); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("y", 0, 120, 500)); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("alpha", 1.0, 0.2, 500)); |
| |
| this.testEffect.target = target; |
| this.testEffect.playheadTime = 500; |
| this.testEffect.stop(); |
| } |
| |
| public function NullConstructor():Boolean |
| { |
| try |
| { |
| this.testEffect = new Animate(null); |
| } |
| catch(error:Error) |
| { |
| return(false); |
| } |
| |
| return(true); |
| } |
| |
| public function ValidConstructor():Boolean |
| { |
| try |
| { |
| this.testEffect = new Animate(this.testPanel); |
| } |
| catch(error:Error) |
| { |
| return(false); |
| } |
| |
| return(true); |
| } |
| |
| public function TargetConstructor():Boolean |
| { |
| try |
| { |
| this.testEffect = new Animate(this.testPanel); |
| } |
| catch(error:Error) |
| { |
| return(false); |
| } |
| |
| if(this.testEffect.target == null) |
| return(false); |
| |
| return(this.testEffect.target == this.testPanel); |
| } |
| |
| public function AddMPVectors():void |
| { |
| this.testEffect.motionPaths = new Vector.<MotionPath>(); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("x", 0, 100, 500)); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("y", 0, 120, 500)); |
| this.testEffect.motionPaths.push(new SimpleMotionPath("alpha", 1.0, 0.2, 500)); |
| } |
| ]]> |
| </fx:Script> |
| |
| <fx:Declarations> |
| <s:Animate id="testEffect" /> |
| </fx:Declarations> |
| |
| <trix:TrixPanel2 id="testPanel" /> |
| |
| <s:Rect id="rect"> |
| <s:fill> |
| <s:SolidColor color="0xFF0000"/> |
| </s:fill> |
| </s:Rect> |
| |
| </s:Application> |