Random Motion

I enjoy the tutorial at


it’s very cool. I was messing around with the code, but i can’t seem to limit the perimeter that the images are moving. The images are moving beyond the set

// specify the width and height of the movie

width = 300;
height = 200;

is there a code that I can allow for the images not to pass the desired width and height?

If you do not know what i’m talking about, u can click on the link above. Notice how the cones go beyond the width and height that is set.

Thanks for reading and any help is appreciated.

These cones are generated movie clips.

You should probably add code to your movie that scripts the bounds of the area where the cones move.

Then the cones will not run off of the side of the visible area.


i try to add this line to my movie clips.

onClipEvent (load) {
//specifies the size of the movie stage
movieWidth = 750;
movieHeight = 470;


it’s not as easy as thought. my canvas is 750 X 470

i’ll do some research