# From as2 to as3

**URL:** <https://forum.kirupa.com/t/from-as2-to-as3/287973>\
**Category:** Uncategorized\
**Created:** [May 8, 2009, 5:09pm UTC](https://forum.kirupa.com/t/from-as2-to-as3/287973 "2009-05-08T17:09:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![turly](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@turly](https://forum.kirupa.com/u/turly)\
**Post date:** [May 8, 2009, 5:09pm UTC](https://forum.kirupa.com/t/from-as2-to-as3/287973/1 "2009-05-08T17:09:55Z")

</div>

Could someone be awesome and write this actionscrip 2.0 code in actioscript 3.0 for me ?

* * *

var radius:Number = 100;  
var degrees:Number = 0;  
var speed:Number = 2;

\_root.onEnterFrame = function()  
{  
angle = degrees \* (Math.PI/180);  
degrees = degrees+speed;

```
yposition = radius * Math.cos(angle);
xposition = radius * Math.sin(angle);

moon_mc._x = xposition + ancor_mc._x;
moon_mc._y = yposition + ancor_mc._y;

```

}

ancor\_mc.onPress = function(){  
startDrag(this);  
}

ancor\_mc.onRelease = function(){  
stopDrag();  
}

* * *
