hi there,
i need to make a menu which consists of items, that are supposed to fold out in a spiral motion around a specific point.
I found some very useful code here on the site: http://www.kirupa.com/forum/showthread.php?t=243118.
to get a better understanding for myself i simplified the code like this:
center = new flash.geom.Point(Stage.width / 2, Stage.height / 2);
this.createEmptyMovieClip("dot",10)
dot.lineStyle(1,0,100)
dot.lineTo(0,1)
dot._xscale=dot._yscale=300
//
function onMouseDown() {
curr_point.x = _xmouse;
curr_point.y = _ymouse;
this.lineStyle(0,0,20);
this.moveTo(curr_point.x,curr_point.y);
}
function onEnterFrame() {
curr_point = curr_point.subtract(center);
var v3 = Math.min(curr_point.length, 200) / 400;
curr_point.x *= .95
curr_point.y *= .95;
//
var m = new flash.geom.Matrix();
m.rotate((1 - v3 * v3) / 5);
curr_point = m.transformPoint(curr_point);
curr_point = curr_point.add(center);
this.lineTo(curr_point.x,curr_point.y);
dot._x = curr_point.x;
dot._y = curr_point.y;
}
Now to make this work for my task i would have to reverse the animation, so that the dot
spirals out from the center to the destination point.
Can someone help me analyze and modify the code accordingly?
I never worked with flash.geom.Matrix and flash.geom.point before and i am kinda stumped.
thanks!