# Translate to AS3

**URL:** <https://forum.kirupa.com/t/translate-to-as3/314642>\
**Category:** flash\
**Created:** [October 5, 2010, 9:11am UTC](https://forum.kirupa.com/t/translate-to-as3/314642 "2010-10-05T09:11:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pafke](https://avatars.discourse-cdn.com/v4/letter/p/5fc32e/32.png) [@Pafke](https://forum.kirupa.com/u/Pafke)\
**Post date:** [October 5, 2010, 9:11am UTC](https://forum.kirupa.com/t/translate-to-as3/314642/1 "2010-10-05T09:11:48Z")

</div>

Can anyone help me translate this to AS3?

mc.tx = random(360);  
mc.ty = random(360);

mc.xtempo = Math.random()/8;  
mc.ytempo = Math.random()/8;

mc.xd = Math.random()\*13+1;  
mc.yd = Math.random()\*10+1;  
mc.x0 = mc.\_x;  
mc.y0 = mc.\_y;

mc.onEnterFrame = function() {  
this.tx += this.xtempo;  
this.ty += this.ytempo;  
this.\_x = this.x0+Math.sin(this.tx)\*this.xd;  
this.\_y = this.y0+Math.cos(this.ty)\*this.yd;  
};
