Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

button on level 0 keeps on playing

Status
Not open for further replies.

leca07

Technical User
Dec 22, 2001
20
0
0
YU
On level 0 there's a button showing some text when rolled over; when clicked, that is "onrelease", a movieclip loads on level 1 - level 0 is still present bellow it. But the problem is when the button on level 0 is rolled over the text appeares again even level 1 is on the top playing - it's very annoying.
The question is: how can I stop the button action on level 0 when level 1 is on the top?
Thnx.
 
You could use a boolean to track whether there is a movie on level 1 or not. Then use that to decide whether or not to show the text on mouseover.

To do that you would state a variable in the first frame of your level 0 main timeline.

Code:
blnMovieLoaded = false;

Then on your button add an if statement:
Code:
on(rollOver){
   if (blnMovieLoaded == false){
      //code to do mouseover text
   }
}
[code]

Then in the movie you load in Level 1 on the first frame of the main timeline add:

[code]
_root.blnMovieLoaded = true;

The only thing that you will need to remember is that when you unload that movie on level 1 (if you ever do) you will want to set the boolean back to false.

You can also change the button to a movieClip which would allow you to control the mouseover as well.

Hope it helps!


Wow JT that almost looked like you knew what you were doing!
 
Or when loading the movie, simply temporarily disable the button along with your loading action...
Code:
...
on(release){
    // loadMovie action...
    _level0.my_button.enabled = false;
}...

When unloading the movie and if you want to re-enable it, simply add...

_level0.my_button.enabled = true;
 
I like that better. It's less complicated!

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top