actionscript as3

Straight up rotation about a center point

Some rotation around the center point straight forward to do

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var hold:MovieClip = new MovieClip();
var r1:red = new red();
 
addChild(hold);
hold.addChild(r1);
 
//r1.x = 200
hold.rotation = 50
 
hold.x = 150
hold.y = 150
         
r1.x = (r1.width/2)*-1 
r1.y = (r1.height/2)*-1 
                                 
addEventListener(Event.ENTER_FRAME, onEnterFrame);
 
 
var i:int = 0;
function onEnterFrame(event:Event):void{
        
        
        hold.rotation = i
        i= i+1;
        }