[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 401
  • Last Modified:

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?
0
wedgenet
Asked:
wedgenet
  • 2
  • 2
1 Solution
 
blue-genieCommented:
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).

blu.

ps obviously to re-enable them you'd just set enabled to true using the same method.
0
 
dutchfoxerCommented:
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.
0
 
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.
0
 
blue-genieCommented:
if they're on different timelines, i'd suggest you provide the full path in the array

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

blu.
0
 
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?
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now