PDA

View Full Version : globalToLocal3D


geeem
01-06-2010, 12:03 AM
Hi

I'm trying to do a simple 3D animation in AS3, which I've previously done using motion tweening.
The idea is that the mc will do a slide onto the stage in 3D. To get this to look right with motion tweening I had to switch the 3D Transition Tool from Global to Local (using the Global Transform button at the bottom of the tools).
Trying to do it in code, I've written the following on a button (I want the animation to occur as I roll over the button)...

import fl.transitions.Tween;
import fl.transitions.easing.*;

words_mc.rotationY = -60

words_btn.addEventListener(MouseEvent.ROLL_OVER, rollOver1)
function rollOver1(event:MouseEvent):void {
var move1:Tween = new Tween(words_mc,"x",Strong.easeOut,-215,400,2,true)
var move2:Tween = new Tween(words_mc,"z",Strong.easeOut,-215,-340,2,true)
}

With this code the mc slides on the stage from left to right, but not with the correct 3D perspective. To do that, the tween needs to be switched from global to local. But How?

Any help would be much appreciated.