# Geometric Clones Mini Tutorial

Geometric Clones Mini Tutorial:

Only 400 bytes!

[swf=“http://www.macromotive.com/ebay/geometric_clones.swf height=200 width=200”][/swf]
<a href=http://www.macromotive.com/ebay/geometric_clones.fla>(Here is the source file for the lazy people)</a>

Step 1:
Set up your stage to 200 x 200, white background, and the FPS to somewhere around 50. Make a new movie clip symbol and place 2 very small circles on the stage, one orange and the other blue. Select one of the circles and align it to the exact center of the clip and then use the arrow keys and press up 5 times and the right arrow key 5 times. Now select the second circle and align to the exact center of the clip and hit the down arrow key 5 times and the left arrow key 5 times. Make a small black diagonal line going from top left to bottom right like shown below and with the line select align to exact center of the clip and then hit the up arrow 20 times and the right arrow 20 times. Look so that your stage looks like mine below:

Go back to the _root timeline and place the movie clip we just made in the gray area off the stage and give it an instance name of ‘original’. Now we are completely done with adding content now we just need the code.

Step 2:
Now open up the actions window and select the movie clip and place this code inside of the actions window:

``````**onClipEvent(load) {**
//Makes the variable used to increase clones, size and location
**i = 0;
}**

**onClipEvent(enterFrame) {**
//The number '150' represents how many clones to
//make, how large they will get and the location
**if(i <= 150) {**
//Makes variable to rename the clones as they duplicate
**clone = "clone_" + i;**
//Duplicates 'this' movie clip and renames according to the var 'clone'
**duplicateMovieClip(this, clone, i);**
//Variable to se the path to the current clone
**path = _root[clone];**
//Used to make the clone larger/smaller by 'width' according to 'i'
**path._xscale = i;**
//Used to make the clone larger/smaller by 'height'according to 'i'
**path._yscale = i;**
//Used to increase the location of clone on the '_x' plane according to 'i'
**path._x = i;**
//I set this to 100 because I wanted the animation to start 100 pixils on '_y' axis
**path._y = 100;**
//Sets the '_rotation' of the clone, the higher the number the more complex of a '_rotation'
**path._rotation = i * 10;**
//Increases the variable 'i' by 1
**i++;
}**
//Makes the 'original' clip invisible
**original._visible = 0;
}**

``````

Step 3:
You can change anything to your likings, just have some fun changing numbers or adding loops and what not. Below is the Final Source File for the tutorial:

<a href=http://www.macromotive.com/ebay/geometric_clones.fla>Final Source File</a>

Really cool dan! The animation is simply out of this world. I’ll add this to the site tomorrow along with novatake’s and ptolemy’s tutorial

Cheers!
Kirupa :asian:

Hey dan,
Just wondering, is there a possibility that this animation is doing more work after it reaches the 150 mark? I found that my CPU resources slowly rising even after the animation reached 150. I was at 98% CPU resources for this animation alone.

What do you think the problem might be? The animation works fine for a few seconds after 150, but beyond that, I think the animation continues to duplicate moves again starting back at the beginning random number.

Thanks,
Kirupa :bandit:

I did the tutorial and found that if you add

``````
if (i>=150) {
i = 150
}

``````

at the bottom of the code (right before the original._visibility = 0) and changed the first i<=150 to just i<150, it lowered my system resources. This could just be me though, my computer can be weird like that.

That isn’t the problem…its that each time the clip is duplicated then so is the code on it which made ‘i’ = 0 so it went on forever!