# Help.. all movie clip moving together

**URL:** <https://forum.kirupa.com/t/help-all-movie-clip-moving-together/306332>\
**Category:** Uncategorized\
**Created:** [March 13, 2010, 4:01am UTC](https://forum.kirupa.com/t/help-all-movie-clip-moving-together/306332 "2010-03-13T04:01:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ismejks](https://avatars.discourse-cdn.com/v4/letter/i/ccd318/32.png) [@ismejks](https://forum.kirupa.com/u/ismejks)\
**Post date:** [March 13, 2010, 4:01am UTC](https://forum.kirupa.com/t/help-all-movie-clip-moving-together/306332/1 "2010-03-13T04:01:40Z")

</div>

Hi, all i’m just learning AS3, hopes you guys can help me.

l just following the lesson on kirupa’s **Classes** and Movie Clips for AS3  
[http://www.kirupa.com/developer/flashcs3/movieclips\_classes\_AS3\_pg4.htm](http://www.kirupa.com/developer/flashcs3/movieclips_classes_AS3_pg4.htm)

My question is:  
im trying rewrite the for loop from time line to class

the problem is instead all the circle moving individually, they moving together. Here is the class.

package {

import flash.display._;  
import flash.events._;

public class Main extends MovieClip {

var radians = 0;  
var speed = 0;  
var radius = 5;

public function Main()  
{

speed = .01+.5_Math.random();  
radius = 2+10_Math.random();

this.addEventListener(Event.ENTER\_FRAME, RotateCircle);  
for (var i:int = 0; i \< 10; i++)  
{  
DisplayCircles();  
}  
}

function RotateCircle(e:Event)  
{  
radians += speed;

this.x += Math.round(radius_Math.cos(radians));  
this.y += Math.round(radius_Math.sin(radians));  
}

public function DisplayCircles()  
{

{

var newCircle:redcir = new redcir();  
this.addChild(newCircle);

newCircle.x = Math.random()\*300;  
newCircle.y = Math.random()_200;  
newCircle.alpha = .2+Math.random()_.5;

var scale:Number = .3+Math.random()\*2;  
newCircle.scaleX = newCircle.scaleY = scale;  
}  
}

}  
}
