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!

Power point presentation style

Status
Not open for further replies.

Gytrash

Technical User
Jul 15, 2003
1
PK
hi everyone,
i am trying to make a presenation on flash, now i want the presenation to be controlled by keyboard, like for example in order to move slide by slide i want to make use of key board, just like we do in power point,
now i have placed a command of stop on every frame but i need now, is that when i press the space key ,it should recognize that key stroke and move one frame forward.
i don't want to use buttons,
now i found out one command , the key command, i wrote the following code( on the frame)
stop ();
if (Key.isDown(Key.BACKSPACE)) {
nextFrame ();
}

it did not work so i modified it and wrote

stop ();
if (Key.isDown(Key.SPACE)) {
x = "1";
}
if (x==1) {
gotoAndPlay (2);
}
have i understood the meaning of key command wrong , and how can i achieve my purpose.
thanx
 
Try this on your first frame...
Code:
stop();
_root.onEnterFrame = function() {
        if (Key.isDown(39)) { // RA = 39
                trace("right arrow key pressed");
				nextFrame();
		}
		if (Key.isDown(37)) { // LA = 37
                trace("left arrow key pressed");
				prevFrame();
		} else {
        		trace(Key.getCode());
    }
};

Or you maybe want to try Key.onKeyUp (AS dictionary) with a listener.

Regards,

cubalibre2.gif

Bacon, eggs and sunshine are still good for me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top