Working with Levels (Loaded SWF) in Macromedia Flash MX

Posted on 2004-11-24
Last Modified: 2012-08-13
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?
Question by:wedgenet
    LVL 39

    Accepted Solution

    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.
    LVL 9

    Expert Comment

    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.

    Author Comment

    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.
    LVL 39

    Expert Comment

    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.


    Author Comment

    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?

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now