Forum Topic: Dialogue in Flash.

(343 views • 6 replies)

This topic is 1 page long.

<< < > >>
Questioning

Alvin-Earthworm

Reply To Post Reply & Quote

Posted at: 7/11/06 04:15 PM

Alvin-Earthworm EVIL LEVEL 22

Sign-Up: 09/23/05

Posts: 17

Anyone know how to skip dialogue in Flash using the Enter key or the Space bar?
I know how to do it with buttons. (stop on the frame and program the button to move to next frame or resume playing the animation) But people don't like clicking the button with the mouse pointer.
I use Flash MX 2004.


None

Kirk-Cocaine

Reply To Post Reply & Quote

Posted at: 7/11/06 04:18 PM

Kirk-Cocaine EVIL LEVEL 34

Sign-Up: 08/17/03

Posts: 16,550

AS: KeyCode

Keycode Getter

If the light is green, the trap is clean.

PSN ID: KirkNG

BBS Signature

None

ViolentAJ

Reply To Post Reply & Quote

Posted at: 7/11/06 04:19 PM

ViolentAJ NEUTRAL LEVEL 26

Sign-Up: 12/08/02

Posts: 3,511

It's simple

if(Key.isDown(Key.SPACE)
{gotoandPlay(#);}

Where "#" is the number of the frame that you want to go to.

Inventor of the "GOLF CLAP" meme.
My stuff

BBS Signature

Happy

Alvin-Earthworm

Reply To Post Reply & Quote

Posted at: 7/13/06 08:52 AM

Alvin-Earthworm EVIL LEVEL 22

Sign-Up: 09/23/05

Posts: 17

Okay. Thanks very much.


None

Mr-Money

Reply To Post Reply & Quote

Posted at: 7/13/06 09:04 AM

Mr-Money NEUTRAL LEVEL 15

Sign-Up: 11/05/05

Posts: 2,272

Of couse, this will only work on an onEnterFrame function.

So, basically, on a frame of your movie in which the dialogue is displayed, have this code:

createEmptyMovieClip("Skipper", 5);
Skipper.onEnterFrame = function() {
if (Key.isDown(Key.SPACE)) {
gotoAndStop(#);
}
}


None

GuyWithHisComp

Reply To Post Reply & Quote

Posted at: 7/13/06 09:18 AM

GuyWithHisComp LIGHT LEVEL 24

Sign-Up: 11/10/05

Posts: 4,027

At 7/13/06 09:04 AM, Mealy wrote: createEmptyMovieClip("Skipper", 5);
Skipper.onEnterFrame = function() {
if (Key.isDown(Key.SPACE)) {
gotoAndStop(#);
}
}

Or:
this.onEnterFrame = function():Void {
if (Key.isDown(Key.SPACE)) {
gotoAndStop(#);
}
};

BBS Signature

Questioning

Alvin-Earthworm

Reply To Post Reply & Quote

Posted at: 7/13/06 03:24 PM

Alvin-Earthworm EVIL LEVEL 22

Sign-Up: 09/23/05

Posts: 17

Thanks for the help, however is it possible to program it to skip to the next frame when the Space bar is released, It skips past the other dialogue if the button is held down.


All times are Eastern Standard Time (GMT -5) | Current Time: 08:30 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!