| <?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. |
| |
| --> |
| <comps:IntegrationTemplate xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:comps="comps.*" width="400" height="300" |
| initialize="onInit()"> |
| <fx:Script> |
| <![CDATA[ |
| import mx.events.FlexEvent; |
| |
| import mx.events.EffectEvent; |
| |
| protected function onInit():void |
| { |
| this.valueFunction = getY; |
| this.toValue = 50; |
| this.fromValue = 150; |
| } |
| |
| protected function getY() : Number { |
| return target.y; |
| } |
| |
| public function performTest(event:EffectEvent) : void { |
| this.enableCheck(); |
| this.effectStart(event); |
| } |
| ]]> |
| </fx:Script> |
| <comps:transitions> |
| <s:Transition id="oneTwo" fromState="One" toState="Two" autoReverse="true"> |
| <s:Move target="{target}" duration="1000" |
| effectStart="effectStart(event)" |
| effectEnd="effectEnd(event)" |
| effectUpdate="effectUpdate(event)" |
| effectStop="effectStop(event)" |
| effectRepeat="effectRepeat(event)" |
| /> |
| </s:Transition> |
| <s:Transition id="twoThree" fromState="Two" toState="Three" autoReverse="true"> |
| <s:Move target="{target}" duration="1000" |
| effectStart="effectStart(event)" |
| effectEnd="effectEnd(event)" |
| effectUpdate="effectUpdate(event)" |
| effectStop="effectStop(event)" |
| effectRepeat="effectRepeat(event)" |
| /> |
| </s:Transition> |
| <s:Transition id="threeFour" fromState="Three" toState="Four" autoReverse="true"> |
| <s:Move target="{target}" duration="1000" |
| effectStart="effectStart(event)" |
| effectEnd="effectEnd(event)" |
| effectUpdate="effectUpdate(event)" |
| effectStop="effectStop(event)" |
| effectRepeat="effectRepeat(event)" |
| /> |
| </s:Transition> |
| <s:Transition id="oneFour" fromState="One" toState="Four" autoReverse="true"> |
| <s:Move target="{target}" duration="1000" |
| effectStart="effectStart(event)" |
| effectEnd="effectEnd(event)" |
| effectUpdate="effectUpdate(event)" |
| effectStop="effectStop(event)" |
| effectRepeat="effectRepeat(event)" |
| /> |
| </s:Transition> |
| </comps:transitions> |
| <comps:states> |
| <s:State name="One"/> |
| <s:State name="Two"/> |
| <s:State name="Three"/> |
| <s:State name="Four"/> |
| </comps:states> |
| <s:Rect id="target" width="50" height="50" |
| y.One="50" x.One="50" includeIn="Two,Four" |
| y.Two="50" x.Two="150" |
| y.Three="150" x.Three="150" |
| y.Four="150" x.Four="50"> |
| <s:fill> |
| <s:SolidColor color="#FF0000"/> |
| </s:fill> |
| </s:Rect> |
| </comps:IntegrationTemplate> |