Hi I have a as3 file (listed below) that simply moves a box along the X axis when a mouse is over it (using Tweenlight) . What I want to do though is put the box on a 30 degree angle and have the box move along this angle. Can anybody tell me what I am doing wrong please ?
import com.greensock.*;
import com.greensock.easing.* ;
cont.addEventListener(MouseEvent.ROLL_OVER, onOver);
cont.addEventListener(MouseEvent.ROLL_OUT, onOut);
var stx:Number;
function onOver(e:MouseEvent):void
{
var stx:Number = cont.x +20 ;
TweenLite.to(cont, 1, { x:stx });
}
function onOut(e:MouseEvent):void
{
stx = cont.x - 20
TweenLite.to(cont, 1, { x:stx } );
}
Here is live example: http://img42.imageshack.us/i/box.swf/