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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding/Showing Layers

Status
Not open for further replies.

digiduck

Programmer
Apr 4, 2003
95
US
How can I hide/show a layer using actionscript?

Also I have a symbol/button that I need to hide/show, I'm trying to do this from a pushbutton that when clicked shows the symbol/button with the following code:
Code:
on (release) {
   symbol._visible="true";
}
then you click the symbol/button to hide it again. Problem is the pushbutton to show the symbol/button doesn't work. It doesn't do anything and no error is outputted.

Thanks for help.
 
You can't hide or show a layer.
You can make invisible or visible a movie clip or a higher level. Put your button in a movie clip, or convert it, give an instance name on stage. I'll use my_mc.
On the first frame of my_mc, add:

this._visible = false; // no quotes!

Don't really know if you're talking about the pushbutton component, for which you'd probably have to use a chnageHandler function, but from another regular button, you can turn on the visibility of my_mc by adding this script to the button...

on(release){
_root.my_mc._visible = true;
}

You could also do it with an onRelease function for this other button, defined on the first frame of your movie...

Regards,

cubalibre2.gif

I'm Bill Watson's biggest fan!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top