|
-
[Help] (AS 2) Going to the next frame and back by pushing spacebar
I want to, when I push the spacebar, go to the next frame, but only when I push the spacebar. And if that frame is up, I want to go to the previous frame by pushing spacebar again. Im sorry if this isnt very specific. If you need more info on what im doing then I can give it.
-
Senior Member
Code:
box.onEnterFrame = function() {
if (Key.isDown(Key.SPACE)) {
if(this.spacekey == false){
this.spacekey = true;
if(this._currentframe == 1){
this.gotoAndStop(2);
}else{
this.gotoAndStop(1);
}
}
}else{
this.spacekey = false;
}
};
-
Should that be put in the action section of my fames? or should it be put in my main coding area? When I put it in my frames, then it still switches back and forth between frames. But when I put it in my box, it says that tehre is no property with the name box. When I put a var in called box, it still keeps going back and forth between screens.
-
Senior Member
The box would be instance name of movie clip that you want to send between frames 1 and 2.
-
so that could really be anything then right? it doesnt have to be box, it could say Pause Screen?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|