goaganesha
Programmer
Hello,
Here's the problem. I've made a pop up menu in flash but it closes right away when the mouse leaves the menu. I want to make some sort of a counter so the menu stays open for a second after the mouse leaves the menu.
In the first frame of the main scene I've created a global variable.
menu1closing = false;
I want this variable to become true when the mouse leaves the menu and then go back to false after 1 second.
so the menu will only close when
onClipEvent(enterFrame)
{
if (! _root.menu1closing)
{
code to close the menu
}
}
to make the variable true I've put this "do while" loop before the previous "if statement"
counter = 0;
do
{
trace (counter);
counter = counter + 1;
}
while (counter < 12 )
this works fine , it counts till 11 and stops
from the moment I change the code to
counter = 0;
do
{
trace (counter);
_root.menu1closing = true;
counter = counter + 1;
}
while (counter < 12 )
an endless loop is being created and the global variable never goes back to false which means the menu stays open.
Does anyone understand what's going wrong?
regards, goaganesha
Here's the problem. I've made a pop up menu in flash but it closes right away when the mouse leaves the menu. I want to make some sort of a counter so the menu stays open for a second after the mouse leaves the menu.
In the first frame of the main scene I've created a global variable.
menu1closing = false;
I want this variable to become true when the mouse leaves the menu and then go back to false after 1 second.
so the menu will only close when
onClipEvent(enterFrame)
{
if (! _root.menu1closing)
{
code to close the menu
}
}
to make the variable true I've put this "do while" loop before the previous "if statement"
counter = 0;
do
{
trace (counter);
counter = counter + 1;
}
while (counter < 12 )
this works fine , it counts till 11 and stops
from the moment I change the code to
counter = 0;
do
{
trace (counter);
_root.menu1closing = true;
counter = counter + 1;
}
while (counter < 12 )
an endless loop is being created and the global variable never goes back to false which means the menu stays open.
Does anyone understand what's going wrong?
regards, goaganesha