?
Solved

Assigning _y Locations Dynamically

Posted on 2005-03-23
3
Medium Priority
?
143 Views
Last Modified: 2010-04-03
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.

0
Comment
Question by:systemride
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
vickerleung earned 1000 total points
ID: 13618158
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
 
LVL 2

Author Comment

by:systemride
ID: 13624254
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
 
LVL 16

Expert Comment

by:vickerleung
ID: 13628927
systemride,

You are welcome

Vicker
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question