# Bringing objects to top

**URL:** <https://forum.kirupa.com/t/bringing-objects-to-top/99294>\
**Category:** Uncategorized\
**Created:** [January 16, 2004, 9:19pm UTC](https://forum.kirupa.com/t/bringing-objects-to-top/99294 "2004-01-16T21:19:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrozenToast](https://avatars.discourse-cdn.com/v4/letter/f/d07c76/32.png) [@FrozenToast](https://forum.kirupa.com/u/FrozenToast)\
**Post date:** [January 16, 2004, 9:19pm UTC](https://forum.kirupa.com/t/bringing-objects-to-top/99294/1 "2004-01-16T21:19:49Z")

</div>

I have 3 layers

3  
2  
1

the bottom layer is my bground (1)

layer 2 is some stars with actionscript to make them move

and layer 3 is on top and is a black tree

When i test the movie the stars appear ontop of the tree.

How can I bring the stars back, or bring the tree to the top?

Thanks in advance  
Andy

edit: here’s the code for layer 2

[AS]onClipEvent (load) {  
// movie width/height  
height = 200;  
width = 500;  
// ------------------------//  
// makes everything random //  
// ------------------------//  
this.\_x = Math.round(Math.random()\*width);  
this.\_y = Math.round(Math.random()\*height);  
var temp = this.\_alpha=Math.random()\*100;  
this.\_xscale = this.\_yscale=temp;  
// setting initiaion position  
cx = this.\_x;  
cy = this.\_y;  
}  
onClipEvent (enterFrame) {  
// causes the object to be offset  
this.\_x = cx+(1+Math.random()\*5);  
this.\_y = cy+(1+Math.random()\*5);  
}[/AS]
