View Full Version : On off button
McFluff03
February 22nd, 2003, 09:17 AM
Hi
I am trying to create a button that when pressed will make an movie clip visible and set it to a specific position on the screen. When this same button is pressed a second time the movie clip will become invisible. any ideas?
jsk
February 22nd, 2003, 09:53 AM
on(Release) {
if(_root.mcInstanceName._visible==false) {
_root.mcInstanceName._visible=true
} else {
_root.mcInstanceName._visible=false
}
}
eyeinfinitude
February 22nd, 2003, 03:17 PM
I just wanted to add to Jsk's code above, if you want it to be set to a certain cordinate on the stage then you'll need to specify the x and y properties so the code would now look like this:
on (release) {
if (_root.mcInstanceName._visible == false) {
_root.mcInstanceName._visible = true;
_root.mcInstanceName._x = 50;
_root.mcInstanceName._y = 50;
} else {
_root.mcInstanceName._visible = false;
}
}
Just change the numbers to whatever you want. =)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.