If and else if?

Hi. My problem is the following - Im trying to use the if condition to activate two menus, menu01 and menu02, that are in the same Y position on the stage. If my ymouse position (considering the _root._ymouse position) is greater than 400 (ymouse > 400) and less than 420 (ymouse < 420), both menus are opened. The condition to open menu01 (on the leftside) and not menu02 (rightside) is the xmouse position. Xmouse > 0 and < 360 would open menu01 and Xmouse > 360 and < 720 would open menu02. I tryied some code but Im having some doubts about if conditions.
Here is what I`ve done:

onClipEvent(enterFrame) {
// impoe a condicao que determina a posicao Y do menu principal
if (root._ymouse > 400) {
} else if (root._xmouse > 0 && root._xmouse < 360) {
_root.menu01.posY = 400;

Was I clear?

I`ve made some advances but than I found out another problem. The menu01, which contains several links (from _x=0 till _x=720) goes over the area (360 < x > 720) that also activate the menu02 and covers menu01 activated before.
Is this the best way to do this? Using the x and y mouse position to activate menus? Does someone knows any better solution?
Thankx again

I see it`s confusing to explain my project. So if someone wants to help me, please send me an e-mail ([email protected]), subject cd-rom help, and I will reply with the swf file. I think this will be a better way.


Trying again. :slight_smile:
How can I write the following in AS. If ymouse > 400 and xmouse < 360, activate menu01. If ymouse > 400 and xmouse > 360, activate menu02 ?
Is the if and else if condition the right way? Please, if you want to help me, read the previous post. Thankx

I not quite sure what you trying tsay, but why dont you try:

on (rollOver) {

(Which just means,when the mouse cursor is over the object the script is added to, Such and such happens.)



(Which just means,when the mouse cursor is not over the object the script is added to, such and such happens.)

I hope this helps.

Yeh. Thats one way Ive already done. But this time Im trying to do this using the mouse position, so that I dont need to create any graphics.
Thankx a lot!