Google Answers Logo
View Question
 
Q: Flash MX - Action - Comand to turn off/on layer ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Flash MX - Action - Comand to turn off/on layer
Category: Computers > Programming
Asked by: bnc_user-ga
List Price: $8.00
Posted: 19 Feb 2003 13:23 PST
Expires: 21 Mar 2003 13:23 PST
Question ID: 163576
Is there a way to turn off and turn on a Layer in Macromedia Flash MX.

I want that when I push a button, that a specified Layer disappears.
When I push the button again, the Layer should appear again.

To answer this question you should provide me with the action script
that turns on and turns of a layer - including the if statement that
finds out whether a layer is already turned on or not.
If there is no such function please tell me how I can solve my
problem.

For clarification:
I have in total 12 buttons - everyone should switch on 7 layers - so
in total there are 84 layers. I have to work with layers as the
interactions of those layers are important. I can not work with frames
as there would be too many combinations possible (2^12).

Request for Question Clarification by skorba-ga on 21 Feb 2003 16:29 PST
Dear bnc_user -

There is no way to turn on and off a layer in flash. A layer is just a
tool for you while you are building your flash movie.

The basic unit in flash is a movie clip. If you turn the content on a
layer into a movie clip, and you give that movie clip a name, then you
can easily "turn that layer on or off". That is accomplished by using
the _visible property of a movie clip.

on (release)
{

}

If this answer will suff

Request for Question Clarification by skorba-ga on 21 Feb 2003 16:32 PST
Sorry about that - the message got chopped:

***

on (release) 
{ 
 if (your_clip._visible) your_clip._visible = false;
 else your_clip._visible = true;
} 

Also - it sounds to me like you would be better off placing all the
seven layers into one movie clip - but of course that might be wrong.

Please tell me if this answer will suffice, and then I can turn it
into a formal answer.

Good luck!

Clarification of Question by bnc_user-ga on 22 Feb 2003 22:28 PST
Thanks for your answer Skorba... I guess I can continue working with
that... You basically answered my question...  and thank you for
answering this one as a clarification, I appreciate this - this gives
other experts the possibility to come up with an answer too.

So you can post an answer and I will give it a positive rating.

I got the answer out of your posts already so there is no need to put
this in a formal answer... or just do a copy paste of your
clarification.
Answer  
Subject: Re: Flash MX - Action - Comand to turn off/on layer
Answered By: skorba-ga on 24 Feb 2003 13:01 PST
Rated:5 out of 5 stars
 
Dear bnc_user - 

Thank you very much. I am honored by your comments. It is for users
like you I post answers.

Skorba
bnc_user-ga rated this answer:5 out of 5 stars

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy