Assigning _y Locations Dynamically

Ok so I have in the root timeline of my movie, some movies with buttons to use a vertical accordian style navigation. So when you click on the first button, it moves the others down to make room for a few sub-menu buttons. I want to be able to have all the menus open at once. I am able to get them to move by assigning a -y number, but I run into a problem when I already have one sub-menu open, the second menu won't continue to move down. Here is a look at my script.

this.onEnterFrame = function(){
      this.block1.m_1a._y += (movem_1a - this.block1.m_1a._y) / 3;
      this.block1.m_1b._y += (movem_1b - this.block1.m_1b._y) / 3;
      this.block1.m_1c._y += (movem_1c - this.block1.m_1c._y) / 3;
      this.block2._y += (movem_2 - this.block2._y) / 3;
      this.block2.m_2a._y += (movem_2a - this.block2.m_2a._y) / 3;
      this.block2.m_2b._y += (movem_2b - this.block2.m_2b._y) / 3;
      this.block2.m_2c._y += (movem_2c - this.block2.m_2c._y) / 3;
      this.block3._y += (movem_3 - this.block3._y) / 3;
}

this.block1.m_1.b_1.onRelease = function(){
        movem_1a = 39;
        movem_1b = 65;
        movem_1c = 91;
        movem_2 = 151;
        movem_3 = 177;
}

this.block2.m_2.b_2.onRelease = function(){
        movem_2a = 39;
        movem_2b = 65;
        movem_2c = 91;
        movem_3 = (this.block3._y + 177);
}

******
I have also tried this for the second button, which works when the first isn't open, but not when the first is open.

this.block2.m_2.b_2.onRelease = function(){
        movem_2a = 39;
        movem_2b = 65;
        movem_2c = 91;
        movem_3 = 177;
}



The Third movie/button is the one I want to continue to move down when clicked on by the second button if the first is already open. Any help would be GREATLY appreciated.

LVL 2
systemrideAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
vickerleungConnect With a Mentor Commented:
systemride

The reason behind is quite obvious

this.block1.m_1.b_1.onRelease = function(){
        movem_1a = 39;
        movem_1b = 65;
        movem_1c = 91;
        movem_2 = 151;
        movem_3 = 177;
}

this.block2.m_2.b_2.onRelease = function(){
        movem_2a = 39;
        movem_2b = 65;
        movem_2c = 91;
        movem_3 = (this.block3._y + 177);
}

When you click the first button

block2 already gone to 151, so how will the sub menu in block2 move to 39, 65 and 91?

So for block2 to work, that should be

this.block2.m_2.b_2.onRelease = function(){
        movem_2a = movem_2 + 39;
        movem_2b = movem_2 + 65;
        movem_2c = movem_2 + 91;
        movem_3 = movem_3 + 177;
}

Vicker
0
 
systemrideAuthor Commented:
Good deal...
it needed to have the pars on it though to work but yeah i got the lightbulb turned on, thanks!

 movem_3 = (movem_3 + 177);
0
 
vickerleungCommented:
systemride,

You are welcome

Vicker
0
All Courses

From novice to tech pro — start learning today.