Solved

hide/show layer useing action script?

Posted on 2003-11-26
5
1,144 Views
Last Modified: 2012-06-27
i would like to know how to hide or show a layer useing action script.

thx.
0
Comment
Question by:frosty5656
5 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 9828173
flash layer or html layer?
0
 
LVL 3

Expert Comment

by:rugu_16
ID: 9828427
hi,
first of all give your layer a name
for example your layers name is home
then
under your button event of keyframe
write down:

home._visible=true;

or to hide

home._visible=false;

inshort :
<layername>._visible=true/false;

thank you
0
 
LVL 23

Accepted Solution

by:
Zeffer earned 29 total points
ID: 9845774
Hi frosty5656

in flash a layer is the levels above one another on the main time-line
you can't show and hide those.

what you can do though is put the content of one of these layers into a movieclip..
select what you want to show and hide and go..insert>convert to symbol
check movieclip and give it a name..say..wheel clip.. so you can easily find it in the library later

with the this clip still selected..open the properties panel and in the 'instance name' box give it a name..say..wheel1

on a button..

on(rollOver){
    _root.wheel._visible = false;
}

on(rollOut)(
   _root._visible = true;
)


there you go..show/hide.. just like dhtml :)

Z
0
 

Author Comment

by:frosty5656
ID: 9847105
too bad layers can't be hidden :(
0
 
LVL 23

Expert Comment

by:Zeffer
ID: 9848301
don't think layers..think movieclips..and they can be..
just reverse the code above to have the clip hide on the stage..and then show on rollover.

Z





0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question