Forum Topic: keypress with a letter problem...

(78 views • 5 replies)

This topic is 1 page long.

<< < > >>
None

Quebecboy

Reply To Post Reply & Quote

Posted at: 8/21/09 08:35 PM

Quebecboy NEUTRAL LEVEL 26

Sign-Up: 06/09/06

Posts: 636

I've got a problem with Flash 8 and AS 2.0

All I want to do is to make Flash going to a certain frame (ex: gotoAndPlay(4412) ;) by pressing the letter ''c''

but I guess it's not as simple as that:

on (keyPress "<c>"){
gotoAndPlay(4412);
}

So anyone can help me? I just started to learn AS

I love ya all!!

BBS Signature

None

the1manwiththeplan

Reply To Post Reply & Quote

Posted at: 8/21/09 08:45 PM

the1manwiththeplan LIGHT LEVEL 14

Sign-Up: 06/10/08

Posts: 441

At 8/21/09 08:35 PM, Quebecboy wrote: I've got a problem with Flash 8 and AS 2.0

All I want to do is to make Flash going to a certain frame (ex: gotoAndPlay(4412) ;) by pressing the letter ''c''

but I guess it's not as simple as that:

Try

onClipEvent(enterFrame){
if(Key.isDown(Key.67)){
_root.gotoAndPlay(4412);
}}

The keycodes can be found here

I went outside once the graphics were awesome but the gameplay was shit

BBS Signature

Winking

Headshot777

Reply To Post Reply & Quote

Posted at: 8/21/09 09:50 PM

Headshot777 FAB LEVEL 21

Sign-Up: 05/04/08

Posts: 3,186

At 8/21/09 08:45 PM, the1manwiththeplan wrote: Try

onClipEvent(enterFrame){
if(Key.isDown(Key.67)){
_root.gotoAndPlay(4412);
}}

The keycodes can be found here

Does it work with Key.67?
I thought it was just "if (Key.isDown(67))" but I guess it works that way too.

12

BBS Signature

None

Quebecboy

Reply To Post Reply & Quote

Posted at: 8/21/09 10:25 PM

Quebecboy NEUTRAL LEVEL 26

Sign-Up: 06/09/06

Posts: 636

It said that there is no clip attached to the event...

does it mean I need to put this code into a clip?a button?

I love ya all!!

BBS Signature

None

Quebecboy

Reply To Post Reply & Quote

Posted at: 8/21/09 10:36 PM

Quebecboy NEUTRAL LEVEL 26

Sign-Up: 06/09/06

Posts: 636

Now it say that there is a '')'' that is missing...

I really doubt that this is what the code is really missing :/...

Any help plz?

I love ya all!!

BBS Signature

None

the1manwiththeplan

Reply To Post Reply & Quote

Posted at: 8/22/09 12:10 AM

the1manwiththeplan LIGHT LEVEL 14

Sign-Up: 06/10/08

Posts: 441

Does it work with Key.67?
I thought it was just "if (Key.isDown(67))" but I guess it works that way too.

Yes your right didn't even bother to check the syntax in flash my bad

so the code should be

onClipEvent (enterFrame) {
	if (Key.isDown(67)) {
		_root.gotoAndPlay(4412);
	}
}
It said that there is no clip attached to the event...

does it mean I need to put this code into a clip?a button?

Yes you need to put the code on a movie clip symbol

I went outside once the graphics were awesome but the gameplay was shit

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 07:47 PM

<< 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!