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

toggling between two button states in actioscript?

Status
Not open for further replies.

hezaa

Technical User
Nov 30, 2005
2
US
I have two button images that are jpegs. Is there a bit of code in actionscript to toggle between them on click?

Thanks!


 
put the two images on different frames in the same movieclip, and make the button code do this:

on(press)
{
if(images_mc._currentframe == 1)
{
images_mc.gotoAndStop(2);
}
else
{
images_mc.gotoAndStop(1);
}
}


if you don't like using frame number, use a boolean to record what picture is showing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top