# Getdepth problem

**URL:** <https://forum.kirupa.com/t/getdepth-problem/283547>\
**Category:** Uncategorized\
**Created:** [March 7, 2009, 9:05pm UTC](https://forum.kirupa.com/t/getdepth-problem/283547 "2009-03-07T21:05:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![uni](https://avatars.discourse-cdn.com/v4/letter/u/9d8465/32.png) [@uni](https://forum.kirupa.com/u/uni)\
**Post date:** [March 7, 2009, 9:05pm UTC](https://forum.kirupa.com/t/getdepth-problem/283547/1 "2009-03-07T21:05:43Z")

</div>

hello there, i have objects on my stage and when i rollover on each object he raize.

exmeple u can see here (here i make only 2 objects):  
[http://cubes.co.il//works/move/move.html](http://cubes.co.il//works/move/move.html)

what i want to do is that all of the objects have the same depth but when one of my object rollovered and he start to raize get the top depth (up then other)

how i can make it?

this is my code…

```auto
stop();
acceleration = 10
newpos = function () {
    ranx = Math.round((Math.random ()*250));
    rany = Math.round ((Math.random ()*250));
}
newpos();
this.onEnterFrame = function() {
    this._x += ((ranx-this._x)/acceleration);
    this._y += ((rany-this._y)/acceleration);
    if (Math.round(this._x) == ranx || Math.round(this._y) == rany) {
        newpos();
    }
};
this.onRollOver = function() {
    gotoAndPlay(2);
}
    

```
