Working with Levels (Loaded SWF) in Macromedia Flash MX

When working with levels, where one has active links on level 0 and an animation overlay on level 1, is there a way to deactivate the level 0 links under the animation overlay in level 1 and then reactivate them when level 1 is unloaded?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the easiest way would be to disable them.

so use buttonname.enabled = false;

if you have quite a few of them, the short cut would be to use an array to store all the names,

ie buttonarray = new Array("projects", "dogs" ,"contact", "sleaze");

when you call your animation into action
use a for loop to loop through and disable each item as in.

function disablebtns() { //create a function
      for (i=0; i<buttonarray.length; i++) {
            eval(buttonarray[i]).enabled = false;
disablebtns(); //call the function when you want to (ie. when your animation starts).


ps obviously to re-enable them you'd just set enabled to true using the same method.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
i know the problem... strange flash has still not resolved this with an easy to use setting / or variable. The above is the most efficient solution.... especially with a lot of buttons.

You need quick and very dirty? Buttons on lower levels can only be hidden with another button. So you could have a transparant button the size of your screen. Again.... very dirty and not advice-able.

Another way would be to stick the buttons in a movieclip. When creating a new level you can tell all the movies to gotoAndStop(2) where the button is now an image/graphic and so has no actions anymore. When removing the new level, gotoAndStop(1) the movieclips again.
But this is a lot of work, action-scripting the whole thing is much cleaner.
wedgenetAuthor Commented:
For buttons to enable and disable, do they have to be within the same Animation sequence? I have multiple animations with buttons that fade in and out with the external SWF that is loaded on level 1 when activated by a specific button within an animated sequence.
if they're on different timelines, i'd suggest you provide the full path in the array

buttonarray = new Array("_root.btn1", "animation_mc.btn2") etc.

wedgenetAuthor Commented:
Where would I assign a button array? Within the Actions window prior to the enable/disable scripts or are they assigned to the specific frame within the timeline where the buttons reside?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.