Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : problems with dropdown menu


buck love
5/21/2004 11:52:30 PM
i have made a dropdown menu that is contained in its own movie clip so that it
doesn't take up frames on root timeline. I have buttons inside the menu so when
the on(rollOver) happens the menu opens but then since the mouse goes over one
of the buttons in the menu it thinks that the on(rollOut) has been activated so
the menu closes. is there any way to avoid this without ruining the
functionality of the buttons?
JFalk1
5/22/2004 2:16:11 AM
I don't know if this is the best solution, but instead of a on(rollOut) on the
menu button, you could:

Extend the frame in your containerMC which has the menu's down state so that
it is the same thing on two frames.
On the first frame put this code:

if (_xmouse>=numeric pixel value for left edge of menu relative to containerMC
&& _xmouse<=right edge && _ymouse>=top edge && _ymouse<=bottom edge) {
play()
} else {
gotoAndStop(menu original state);
}

and on the second frame:

gotoAndStop(first frame of down state);

Basically, once the menu is in the down state, if the cursor is between the
coordinates you enter (the extents of the menu) it will continue to go back and
forth between the two frames (nothing will change because the frames are
identical). When the cursor moves outside the coordinates the playhead returns
to the orignial state of the menu.

AddThis Social Bookmark Button