Solved

hide/show layer useing action script?

Posted on 2003-11-26
5
1,143 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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

832 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