Hi,

I have a problem with a combined move and rotate (3D) with a spark component. 
When the effects are played reverse the component is displaced when the effects 
begin to play. But I don't know why this happens.

I have attached the simple example for that. 

Maybe there is another approach to achieve the same effect? Or am I doing 
something wrong?

Any help appreciated.

Markus

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
xmlns:s="library://ns.adobe.com/flex/spark" 
xmlns:mx="library://ns.adobe.com/flex/halo" 
minWidth="1024" minHeight="768"
creationComplete="creationCompleteHandler(event)">

<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import spark.effects.Move3D;
import spark.effects.Rotate3D;
private var myMove3D: Move3D;
private var myRotate3D: Rotate3D;
                        
protected function creationCompleteHandler(event:FlexEvent):void
{                               
myRotate3D = new Rotate3D(myPanel);
myRotate3D.angleXFrom = 0;
myRotate3D.angleXTo = 77;
myRotate3D.duration = 1000;
myRotate3D.repeatCount = 1;
myRotate3D.play();
                                
myMove3D = new Move3D(myPanel);
myMove3D.xFrom = 0;
myMove3D.xTo = 300;
myMove3D.duration = 1000;
myMove3D.repeatCount = 1;                       myMove3D.play();                
                
                                
setTimeout(reverse, 3000);
}
                        
private function reverse(): void
{       
//Play reverse
myRotate3D.play(null, true);
myMove3D.play(null, true);
}
                        
]]>
</fx:Script>
        
<s:Panel width="300" height="300" id="myPanel"/>
</s:Application>

Reply via email to