I’m a newbie to Flash. I have created a basic screensaver which has 8 different layers. 7 are hidden and 1 plays through as it is now. I was wondering if there is any way that on completing the timeline, it starts the timeline again and then shows the second layer and masks the 1st one. It would then do the same, masking the 2nd layer and showing the 3rd and so on.
I may have gone about it in completely the wrong way but any guidance would be appreciated.
Thanks!
You can’t hide / show layers with actionscript, but you can turn visibility on and off.
Each of your layers is probably its own MovieClip (if they’re not, then try and make each one its own MovieClip). Give each of these an instance name (screen1, screen2, etc). Then you’ll want to make an event handler that catches the timeline starting over, and lets you execute some code when that happens. It may be necessary to make your own frame counter variable. This code would go on the first frame of the timeline (usually in it’s own layer). Something like this :
Hopefully that’s enough to at least get you a good start. Remember that this code should be in its own keyframe on the first frame of your main timeline. Typically it’s best to make that keyframe in its own layer and call it ‘actions’.
Truth be told, it’s generally accepted as best practice not to have any code in your timeline and instead use .as (actionscript) files to organize your code. But that’s a topic for another day, and for now, this solution will probably do just fine.
Good luck!