|
-
hi... Ihope u can help me with this problem!!!
I have written a script that will detect if a certain key is pressed using (if.isdown(anykey))
my problem is that this script can only detect a single key press,
i want it to be able detect a two key press like (shift+anykey)
is it possible ????i'v tried every thing a could but no use..please help..thx anyway!!
-
OG
use actions!
- Posting from the mall -
<< ^^ - Therefore, my description will be detailed when I get to my desktop.
_____>>
Just use actions my friend!
All you have to do is get into your frame actions, and select: "when key pressed"... this will write the action script for you.. saving u the hasstle of playing with your own written actions.
I'll get backto you with details when i get to my desktop!
Irfaan
-
According to the Flash 5 Bible, "Multiple key combinations are not supported.This rules out diagonals as two-key combinations in the classic four-key game control setup. It also means shortcuts such as Ctrl-S are not available."
Cheers,
Bryan T
-
Originally posted by BrainTea
According to the Flash 5 Bible, "Multiple key combinations are not supported.This rules out diagonals as two-key combinations in the classic four-key game control setup. It also means shortcuts such as Ctrl-S are not available."
Cheers,
Bryan T
I have a .fla right here right now that allows you to control a simple dot around the screen with 1 key (left right up down) or 2 keys (up+right up+left down+right down+left) to make it go on a diagonal.
Here, check out the .swf for yourself. http://www27.brinkster.com/nerdinside/keyisdown.swf (click on the .swf before you hit a key. use the arrow keys.
[Edited by NerdInside on 01-06-2002 at 02:21 AM]
-
OG
care to elaborate??
NerdInside -
Would you care to go one step further to help -amjad_ghost- by explaining the process one would use to accomplish this task, or just paste your script?? Thx.
Irfaan
(Nice example)
-
You just wanna know dont ya? I am gonna try to make it work with Shift+A to then goto a frame, if I get it to work I will post it.
-
Ok, this was quick.
Add this to a MC that is outside the frame (so you cant see it):
Code:
onClipEvent (enterFrame) {
if (Key.isDown(Key.SHIFT)) {
if (Key.isDown(Key.SPACE)) {
_root.gotoAndPlay (2);
}
}
}
Then, when the user hits SHIFT and then SPACE they will go to frame 2.
The one used on that sample is this:
Code:
onClipEvent(enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_root.circle._x++;
}
if (Key.isDown(Key.LEFT)) {
_root.circle._x--;
}
if (Key.isDown(Key.UP)) {
_root.circle._y--;
}
if (Key.isDown(Key.DOWN)) {
_root.circle._y++;
}
}
Add that to a MC that is outside the frame. Give what you want to move th instance of circle.
-
howdy,
just use two separate movie clips with 'on clip event' handlers. 1 clip has the first 'key.isDown' and the other is on the second clip and detects the second key. Works for me.
cheers
Pixel Boy
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
|