• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Hide Layer in AS3

New Here ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

Hi

I want to know how can I hide a particular layer during a mouse click event.

Thanks

Ankur

TOPICS
ActionScript

Views

7.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Jan 11, 2011 Jan 11, 2011

- Is there any way to hide a layer for a particular action?

No. You can put them all in one movieclip or you can give them all instance names like:

layer1_mc1 , layer1_button1 etc.... and iterate ...

Votes

Translate

Translate
Advocate ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

You can't do that.

you can hide ( visible = false ) the movieclips and the buttons with instance names in that layer....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

Hi

Thanks for your reply.

Hiding movie clips and buttons is an option. But in case when there are too many of these, then it becomes a tedious task. Is there any way to hide a layer for a particular action?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

Please note "layer" is merely a visual aid only exists in Flash authoring timeline. There are no "layers" in the compiled SWF, everything is "flattened".

To achieve what you want you can either put your object in a Sprite/MovieClip and hide it, or write a script to iterate objects in a loop to hide them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 11, 2011 Jan 11, 2011

Copy link to clipboard

Copied

- Is there any way to hide a layer for a particular action?

No. You can put them all in one movieclip or you can give them all instance names like:

layer1_mc1 , layer1_button1 etc.... and iterate ...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 11, 2015 Sep 11, 2015

Copy link to clipboard

Copied

LATEST

The more I write in flash the more I think it's a bad joke.

You see lots of nice things, but they never work as expected, or are half baked.

Layers ? Of course, only you can't use them hahaha

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines