1 person found this helpful
you can't control layers with actionscript. you'll need to convert each object in a layer you want to control into a movieclip. you can then control the _visible properties of your movieclips.
you don't need to use an if-statement to check from mouse-overs. assign your buttons instance names and use code similar to:
// do whatever. say:
mc._visible = true;
mc._visible = false;
Thank you for your response
kglad's answer was clear.
Do buttons and graphics have _visible properties?
in as3, buttons and movieclips have a _visible property.
graphics cannot be referenced using actionscript.
Are movie clips, buttons, and graphics "local" to their layer (or to something else), or are all Flash object global?
For example, is it possible to have two separate buttons with the same name, used as follows:
layers only exist in the authoring environment. they don't exist in a published swf so they can't be referenced using actionscript. (layers are used by the flash program to assign depths to objects only.)
all objects in as2 flash are local unless explicitly defined as _global.
all objects defined on timelines in flash are local to the timeline/movieclip in which they are defined.
"you can then control the _visible properties of your movieclips"
Apparently in AS3, the syntax has changed. It now takes the following form:
the typo was writting as3 instead of as2 which is the version discussed in this thread.
not trying to be critical--your answer was a big help. I'm just posting for completeness should another person have the same question.
i understood your "for posterity" as not being derogatory but intended to help anyone else that might check this thread in the future. no offense taken.