Trouble with dynamic positioning _y

I’m stumped with this maybe someone here can help.

I have a list of collapsible move clips.
When anyone of the clips is closed or opened the rest or the clips in the list react by changing position.
I had this running with and on enter frame event. But that was a memory hog when too many items were in the list.
So what I want to do is this
When any clip is closed or opened it triggers this function

function resetY() {
   
  for (var i = order; i>=many; i++) {
  **this.onEnterFrame = function() {**
  _y = previousitem._y+previousitem.box._height;
  roundB4me = Math.ceil(previousitem._y+previousitem.box._height);
  roundme = Math.ceil(_y);
                          if (roundB4me == roundme) {
                                      delete this.onEnterFrame;
                          }
   
                          
              }
  }

My problem is with placing this clip on clips in the _parent.
So what I want is more like this:

function resetY() {
   
  for (var i = order; i>=many; i++) {
  **_parent[nextClip+i]onEnterFrame = function() {**
  _y = previousitem._y+previousitem.box._height;
  roundB4me = Math.ceil(previousitem._y+previousitem.box._height);
  roundme = Math.ceil(_y);
                          if (roundB4me == roundme) {
                                      delete this.onEnterFrame;
                          }
   
                          
              }
  }

But I cant use: _parent[nextClip+i]onEnterFrame = function() {
Can any one help me out with this?
Thanks for any help!

That alternative still uses onEnterFrame though.

ummm… you can do this:

function resetY() {
   
  for (var i = order; i>=many; i++) {
var blah:MovieClip = _parent[nextClip+i]
  blah.onEnterFrame = function() {
  _y = previousitem._y+previousitem.box._height;
  roundB4me = Math.ceil(previousitem._y+previousitem.box._height);
  roundme = Math.ceil(_y);
                          if (roundB4me == roundme) {
                                      delete this.onEnterFrame;
                          }
   
                          
              }
  }

btw _parent[nextClip+i]onEnterFrame = function() { wont work… you forgot a dot… _parent[nextClip+i]**.**onEnterFrame = function() {

figures i left out the period…:sigh:

but like was mentioned it still used on enter frame like 25 at a time.
so i just paced them one after the other.


function resetY(clicked) {
        nextclip=clicked+1
        nextafter=clicked+2
        var nextup:MovieClip = _parent["textholder"+nextclip]
        var nextafter:MovieClip = _parent["textholder"+nextafter]
        nextup.onEnterFrame = function() {
            nextup._y = nextup.previousitem._y+nextup.previousitem.box._height;
            roundB4me = Math.ceil(nextup.previousitem._y+nextup.previousitem.box._height);
            roundme = Math.ceil(nextup._y);
            if (roundB4me == roundme) {
                nextafter.resetY(nextclip)
                delete this.onEnterFrame;
            }
        };
}

so now only one on enter frame even happens at a time making the whole thing run much smoother!
thanks for all your help!