blob: a38dd9c4a8013c9e5d7db6ed6f923fc308c92999 [file] [log] [blame]
<?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.
-->
<!-- Simple example to demonstrate the s:Rotate3D class. -->
<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">
<!-- Standalone effects must be declared in the "Declarations" tag in Flex 4 -->
<fx:Declarations>
<s:Rotate3D id="rotateEffect" target="{targetBox}"
angleXFrom="0" angleXTo="180" angleYFrom="0" angleYTo="180"
duration="1000" autoCenterTransform="true"
effectStart="playButton.enabled=false" effectEnd="playButton.enabled=true;"/>
</fx:Declarations>
<s:Panel title="Rotate3D Effect Example"
width="75%" height="75%">
<mx:HBox width="100%" height="100%">
<!-- Our target to affect -->
<mx:VBox id="targetBox" width="50%" horizontalAlign="center">
<mx:Label text="Sample Image"/>
<mx:Image source="@Embed(source='assets/c2.png')"/>
</mx:VBox>
<!-- Directions -->
<mx:VBox id="detailsBox" width="50%" left="0">
<mx:Text width="99%" color="blue"
text="The Rotate3D effect rotates a target using the following parameters: angleXFrom, angleXTo, angleYFrom, angleYTo, angleZFrom, and angleZTo. Click 'Rotate3D' to watch the effect."/>
</mx:VBox>
</mx:HBox>
<s:Rect left="0" right="0" bottom="0" height="30">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0xE2E2E2" />
<s:GradientEntry color="0xD9D9D9" />
</s:LinearGradient>
</s:fill>
</s:Rect>
<!-- End then Play the effect to rotate the target.-->
<s:Button id="playButton"
left="5" bottom="5"
label="Rotate3D" click="rotateEffect.play();"/>
</s:Panel>
</s:Application>