How to Navigate to a frame in a movieclip type symbol?
What I mean is, like to pick up an item in-game and then use it. for example a pair of tweezers, when you click they shut, and when you click again, they open. I am unsure on how to do this.
What I mean is, like to pick up an item in-game and then use it. for example a pair of tweezers, when you click they shut, and when you click again, they open. I am unsure on how to do this.
The commands you would use would be along the lines of....
tweezer.gotoAndStop("shut");
tweezer.gotoAndStop("open");
where you have assigned an instance name of "tweezer" and you create those labels in the tweezer instance's timeline.
For the clicking part you could do something like the following to incorporate them...
var tweezerShut:Boolean = false; // assuming they start off open
tweezer.addEventListener(MouseEvent.CLICK, useTweezer);
function useTweezer(evt"MouseEvent):void {
if(tweezerShut){
tweezer.gotoAndStop("open");
} else {
tweezer.gotoAndStop("shut");
}
tweezerShut = !tweezerShut; // update the status to its opposite
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.