1
votes

I created a flash layout for a brochure software we're using and I'm running into a layering issue.

When someone clicks on one of the "+" buttons, it changes the image to the right and goes to a frame that plays a simple animation to bring up the "lightbox".

The issue I'm having is that the "+" buttons that are covered by a lightbox at some point won't function, even if those layers aren't active at that point in the timeline.

Is there a way to have the button layer be on top until clicked on? Once it's clicked, the movieclip layer should be on top.

I attached a sample of the layout here.

enter image description here

3

3 Answers

1
votes

Hide layer without codes.

  1. Click layer
  2. On properties click fill > alpha , from 100 change it to zero (transparent)

By the way, the answer above gives you headache. The person asked for a simple solution, but you confused him.

0
votes

You can set the visible property of those layers to false

0
votes

If you are wanting throw certain objects on top during run time (not during editing), look into setChildIndex() to re-arrange which object is on top of the others in your swf.

    import flash.events.MouseEvent;

    // Listen for a click (you would want to add for each of your buttons, 
    // optionally an array or vector would be handy here)
    yourButtonName_mc.addEventListener(MouseEvent.CLICK, buttonClicked);

    // Whenever your button is clicked call this
    function buttonClicked(evt:MouseEvent)
    {
        // Throw the specific object on top of everything else
        // This assumes that thingToThrowOnTop_mc is a direct child of the stage
        setChildIndex(thingToThrowOnTop_mc, numChildren-1);
    }

You can also look into swapChildren() or the other variants as well.

Please keep in mind that layers only exist at run time for convenience in editing, when the swf is running they no longer exist; however, objects that were in layers are usually MovieClip instances or other DisplayObjects. In case you were not aware, adding an instance name to these objects will allow you to access them directly via ActionScript.