2 Replies Latest reply on Oct 15, 2008 12:59 AM by paraprae

    Hide / Show Layers after published?

    paraprae Level 1

      Hi all, sorry if this questions a bit lame, im pretty new to flash.

      I currently have a flash file, which has 30 frames each with diff image on. And i have a menu across top with buttons that link to each frame to view them. Now i have 30 other images which have slight differences on them. I want to create a button that will switch between the normal images and different images. like a show different on / off.

      I was wondering if i could put the different images on a new layer in flash, then have a button that turns that layer on/off . But i'm not sure if you can access these layers like that after a file has been published?

      Thanks for any help.
        • 1. Re: Hide / Show Layers after published?
          RossRitchey Level 4
          You cannot access the layers, no.

          What you can do, is make each image a Movie Clip, give it an instance name (in the properties panel when you have the clip selected) and then code the button to turn the visibility of that Movie Clip on and off.


          This is AS2, and assumes that the images are named (img1,img2,img3,etc) and the buttons are named (btn1,btn2,btn3,etc). The code goes in the actions on a frame.

          btn1.onPress = btn2.onPress = btn3.onPress = function(){
          var num = this._name.split("btn")[1];

          var img = _level0["img"+num];

          img._visible = false;
          img._visible = true;

          • 2. Re: Hide / Show Layers after published?
            paraprae Level 1
            Hi, Thanks for your reply. I see what your saying, but i cant get quite what i want.
            I've posted again with a better explanation but thanks, and have a look at the other post if ya can :)