I am trying to use Twease engine to edit stuff in fake 3d per Keith Peters book Actionscript Animation with this code below.
I want to do to things, have it meld with the fake 3d scaling, and be able to feed it the _z value. So far I am unsuccessful in my grasp of lower level AS2
Pleeaase help :D,
Twease site
http://play.visualcondition.com/twease/
import com.visualcondition.twease.*;
var numBalls:Number = 1;
var x:Number = 0;
var y:Number = 0;
var z:Number = -240;
var fl:Number = 250;
var vpX:Number = Stage.width / 2;
var vpY:Number = Stage.height / 2;
init();
function init() {
for (var i:Number = 0; i<numBalls; i++) {
var ball:MovieClip = attachMovie("ball", "ball" + i, i);
ball.x = 0;
ball.y = 0;
ball.z = 100;
}
}
function onEnterFrame():Void
{
for (var i:Number=0;i<numBalls;i++) {
var ball:MovieClip = this["ball" + i];
//x = _xmouse - vpX;
//y = _ymouse - vpY;
if(Key.isDown(Key.UP))
{
ball.z+=5;
}
else if(Key.isDown(Key.DOWN))
{
ball.z-=5;
}
if(z <= -fl)
{
ball._visible = false;
}
else
{
ball._visible = true;
var scale:Number = fl / (fl + ball.z);
ball._xscale = ball._yscale = scale * 100;
ball._x = vpX + x * scale;
ball._y = vpY + y * scale;
}
}
}
Twease.tween({target:ball, _y:900, time:2});