Solved

hide/show layer useing action script?

Posted on 2003-11-26
5
1,148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

728 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