Disabling buttons on lower layer

I have what would seem to be a simple question. I’m working on a test where the user must find specific error keywords on a document and click on them to identify them as errors. After they click on an error, a movieclip popup displays to tell them they did a good job and explain why the error is an error.

On the movieclip that pops up, I’ve got a standard X close button to kill the movieclip. The problem is, when you click on the close button, the 20 buttons on the document below are still active, and can still be clicked on. Is there a simple way to disable them all, but only when a popup movieclip is being displayed?

welcome to kirupaville Sarabellum!!! =)

paste this script in the timeline

enable = function(action) {
	for (clips in this) {
		this[clips].enabled = action;
	}
}

then place all your buttons into a movie clip.

to disable the buttons in the movie clip

movieclipInstanceName.enable(false);

to enable the buttons in the movie clip

movieclipInstanceName.enable(true);

hope it helps :slight_smile:

Thanks for the welcome, kax.

No luck on the script, but I realized I would need to do some further explanation on this. Let me try to break it down into something that is hopefully not as confusing as the .fla is. (I really need more work making these things easy to approach and figure out from a developer’s point of view!)

The document I’m referring to is a standard letter-size form which I reproduced in Flash. I’m using the scrollPane component so that the user can see the whole thing. (Hence all the trouble.)

So, I’ve got my form movieclip, and within that are 20 clickable form error movieclips. When you click one of these, the movieclip timeline advances to display a checkmark, and calls a movieclip out on _root, which is the little pop-up “good job” message and explanation.

The problem with trying to use the enable or visible commands to hide the buttons is that they are not actually on the main stage. They are embedded within the form movieclip, which is referenced as the scroll content by the scroll pane component. The form movieclip is not actually on the main stage. So I guess my problem is with trying to target movieclips within scrollPane components.

Has anyone delved into the scrollPane component enough to answer this?

I’ll try to get an .swf up so you can see what I mean.

ok … :slight_smile:
i never use components … i prefer to make my own stuff =) [size=1]it’s more fun ;)[/size]

the point is … i guess it shouldn’t be a problem
just target the scrollpane and then the movie clip or whatever you want to disable

ie.

scrollpaneInstance.movieclipInstance.enable(false);

however … it would be easier for us if you could attach your fla :slight_smile: … ?

The fla is too big for the forum, so I put it up on my personal server. You may have to right-click and choose “Save Target as…”

http://www.oxdragon.com/portfolio/

Thanks for the help.

The scrollpane movieclip is called “cfs1001”, which is on the 3rd frame of the main timeline. The scrollpane itself is labelled scrollpane2 (inventive, huh?). If you open cfs1001 from the library, you’ll see error9 through error24.

I know I’ve really mucked this up. I’ve never used components before either, as I’ve always preferred to figure it out for myself, but since there has been a time crunch on this project, I thought I’d give it a try. I apologize for the state of the fla… you can tell everything just fell into place as I discovered what worked and what didn’t.

ok … after more than an hour playing around with it and still no luck :-\

another option could be …
create a movie clip of the size of the scrollpane with a script like this in its timeline:


this.useHandCursor = false;
this.onRelease = function() {
	trace("click");
}

now when you click on the errors set its _visible property to true
and when you close the windows set its _visible property to false
:slight_smile:

That solution almost works… except that it disables the close button on the window that pops up as well. Any ideas for how to get around that?

After trying a lot of different seemingly workable solutions, I finally figured a passable one out. I had originally put all of the popup messages on the root timeline to make them easier to manipulate, but I found if I embed them within the clickable errors, they still work, but they now scroll with the form, so I can at least be sure that a user doesn’t mistakenly click on another error while clicking the close button, and I don’t have to worry about how the message lines up with the form below while scrolling. The user can still click on other errors with the popup message up, but I’ll call that one user error rather than a bug. :slight_smile: