Skip to main content
Participant
December 26, 2008
Question

Toggling a layer's visibility

  • December 26, 2008
  • 2 replies
  • 1300 views
I've got several layers in the timeline and I'd like to know the most effecient method to toggle the visibility of any one of the layers when a user clicks a button I have on the form.

The layers are all simply graphics that have been imported and the only functino they have on the time line is that they each come in at different times during the playback of the movie. I'd like to have the ability to toggle the individual layer when a user clicks the button.

Feedback is greatly appreciated.

This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
December 27, 2008
i can't envision your set-up. what's the difference between what's on-stage in frame 1 vs frame 2?
kglad
Community Expert
Community Expert
December 27, 2008
you can't control layers with actionscript. they don't exist, as such, after publication.

you can control the visibility of individual displayobjects. and you can mask layers and control the mask.
Participant
December 27, 2008
THanks for the reply. I recall having read that in a post made several months ago. I guess I'm not sure how to handle the task at hand then. In the previous thread(s) I had read, it was recomended to convert the layer into a movie object and toggle it's visibility. I'm still getting a handle on the flash object model and I can't say that I've got a firm grasp just yet. I've got a very simple flash movie with our County map as the very base layer and then for the first 25 frames I've got an image showing specific locations (exported as an image from a GIS). THen from frames 26-50 I've got the previous layer visible and an additional layer turns on with more locations identified. I was hoping to give the user the ability to toggle any of the layers on and off on the click event of a couple buttons I have.

I'm also wondering if I've got the movie set up in the most effecient manner? I've got a next button that goes from 1-25 on the first click and then from 26-50 on the second and then 51-75 etc.... In terms of a movie playing though, there's really no animation.