• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1154
  • Last Modified:

hide/show layer useing action script?

i would like to know how to hide or show a layer useing action script.

thx.
0
frosty5656
Asked:
frosty5656
1 Solution
 
negatyveCommented:
flash layer or html layer?
0
 
rugu_16Commented:
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
 
ZefferCommented:
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
 
frosty5656Author Commented:
too bad layers can't be hidden :(
0
 
ZefferCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now