Solved

hide/show layer useing action script?

Posted on 2003-11-26
5
1,141 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
Comment Utility
flash layer or html layer?
0
 
LVL 3

Expert Comment

by:rugu_16
Comment Utility
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
Comment Utility
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
Comment Utility
too bad layers can't be hidden :(
0
 
LVL 23

Expert Comment

by:Zeffer
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
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 how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now