ActionScript function (move object with cursor)
I have created a piece of code, based on code from this tutorial
Design simple interactive content |
which makes the object turn at 180 degree following the cusor movements.
I like to ask if anybody can tell me what code I should use, if I would like the object to follow the cursor around the stage ?
I have the following code in ActionScript 3,
stage.on('stagemousemove', function(e){
var radians = Math.atan2(e.localY - _this.test.y, e.localX - _this.test.x);
var degrees = radians * (180 / Math.PI);
_this.test.rotation = degrees - 180;
});
Also if anybody could tell me where to find ActionScript code in general and if possible examples of ActionScript code and functions.
Thanks
