This Blog contains About Action script 3.0 Variables, Data types, Access specifies, Keywords, Operators, Conditional statements, Control statements, Arrays (Indexed, Associative, Multidimensional, Cloning), Functions, Symbols, Movie clips (Transformation point, Registration point, Loading images), Buttons, Events (Key board, Mouse, Timer, XML)Pre- defined function :- Random, Hit test object, Drag and drop, Sort, Loader, Tween,URL Loader, Video components, Audio Components, Sound Channel.
Friday, 8 March 2013
rotate a stick continuously in as3
Code :-
=====
stage.addEventListener(Event.ENTER_FRAME,rotate);
function rotate (e:Event){
var theX:int = 5//mouseX - arrow.x;
var theY:int = 13//(mouseY - arrow.y) * -1;
var angle = Math.atan(theY/theX)/(Math.PI/90);
trace(angle);
arrow.rotation -= (angle*-1) + 90
}
Out put :-
======
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment