Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Actionscript to turn layers on/off with buttons. 1

Status
Not open for further replies.

irate

Programmer
Jan 29, 2001
92
GB
I have a load of layers. (More than 20) And one or two layers with buttons and checkboxes.
What is the best actionscript to make each button/checkbox turn on/off a layer.
ie. when you click button one, layer one becomes invisiable then when you click it again the layer becomes visable again...
 
hi

You can't turn layers on and off. What you would have to do is put your content into movie-clips, then you can use the 'swapdepth' or 'instancename._visible=0' and 'instancename._visible=1' actions.

Or, you could create a single movie-clip with each of the 'layers' cut/pasted into successive frames of the movie-clip and then use the instancename.gotoandstop(framenumber) action on your buttons.

I'm in a bit of a rush at the minute but if you need more clarification on this (the Help files should explain the coding) just ahout.

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top