| <?xml version="1.0"?> |
| <!-- |
| |
| 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. |
| |
| --> |
| <!-- Simple example to demonstrate the s:Keyframe and s:MotionPath classes. --> |
| <s:Application |
| xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:mx="library://ns.adobe.com/flex/mx" |
| xmlns:s="library://ns.adobe.com/flex/spark"> |
| |
| <fx:Declarations> |
| <fx:Vector id="kf" type="spark.effects.animation.MotionPath"> |
| <s:MotionPath property="scaleX"> |
| <s:Keyframe time="250" value="0.5"/> |
| <s:Keyframe time="500" value="1.0"/> |
| <s:Keyframe time="750" value="0.5"/> |
| <s:Keyframe time="1000" value="1.0"/> |
| <s:Keyframe time="1250" value="0.5"/> |
| <s:Keyframe time="1500" value="1.0"/> |
| </s:MotionPath> |
| <s:MotionPath property="scaleY"> |
| <s:Keyframe time="250" value="0.5"/> |
| <s:Keyframe time="500" value="1.0"/> |
| <s:Keyframe time="750" value="0.5"/> |
| <s:Keyframe time="1000" value="1.0"/> |
| <s:Keyframe time="1250" value="0.5"/> |
| <s:Keyframe time="1500" value="1.0"/> |
| </s:MotionPath> |
| </fx:Vector> |
| |
| <s:Animate id="shrinkEffect" |
| motionPaths="{kf}" |
| target="{myImage}"/> |
| </fx:Declarations> |
| |
| <s:Panel id="examplePanel" |
| title="Keyframe and MotionPath Effect Example" |
| width="75%" height="75%"> |
| <s:layout> |
| <s:VerticalLayout paddingTop="10" paddingLeft="10"/> |
| </s:layout> |
| |
| <!-- Directions --> |
| <s:VGroup id="detailsBox" width="50%" left="0"> |
| <s:Label width="99%" color="blue" |
| text="Click the Adobe logo to watch the effect."/> |
| </s:VGroup> |
| |
| <mx:Image id="myImage" |
| source="@Embed(source='assets/logo.jpg')" |
| click="shrinkEffect.end();shrinkEffect.play();"/> |
| </s:Panel> |
| </s:Application> |