View Full Version : disable keypress
scigolf
March 19th, 2002, 09:40 PM
Hi,
Is there a way to stop keyboard input? I have a game where a user moves an object on the stage using the arrow keys. I want the object to stop moving upon collision, but I don't know how to tell flash to stop accepting keypresses. Any help?
Thanks!
Scigolf
I am not Jubba
March 20th, 2002, 04:32 AM
I figured out a way to do it... you want something like this right?
<embed src="http://www.angelfire.com/dc/vidgame/tutorials/hittest.swf" height=100 width=200></embed>
I made a MC with A button in Frames 1 and 2. In frame one the button has the KeyPress code, in the second frame it doesnt. Then a stop command in each frame. Then for the hit test, just tell the MC to goto and stop frame 2
here is the fla
click here for FLA!! (http://www.angelfire.com/dc/vidgame/tutorials/hittest.html)
there might be an easier way, but this works for me and it might work for you.
to get the animation to work, click on the box first.
I am not Jubba
March 20th, 2002, 04:39 AM
dam, it feels good to be able to answer questions and actually be able to test the things that i'm trying to answer. No more wrong answers from jubba! :)
I am not Jubba
March 20th, 2002, 01:58 PM
oh yeah, you could also use if statements, but that requires more code.
I am not Jubba
March 21st, 2002, 12:54 AM
DID THIS HELP YOU!?!
ilyaslamasse
March 21st, 2002, 01:05 AM
Don't you just hate this ?? You worked your as off for someone who probably posted in every Flash forum he could fine, and who will probably never check that post again...
Be strong Jubby Boy !
pom 0]
scigolf
March 21st, 2002, 08:28 AM
Hi,
Yes, thanks for your help! It did work and I am currently looking at incorporating it into my program. Thanks again!
I'm sorry that my response wasn't timely. I have other areas in my life (family, job) which often require more attention than my current hobby (flash). And , no, ilyaslamasse, I did not post in all the forums I could find, just this one.
Scigolf
I am not Jubba
March 21st, 2002, 09:11 AM
thats ok. Its just that if I respond to someone, I like to know if what i told them helped. I didn't really work my *** off, because as soon as i read his post I knew what to do, and then it only took 3 minutes to do it. So it wasn't a big deal. I'm glad I helped. good luck. Oh, and don't listen to Pom, he's just mad at the world because he's French.
ilyaslamasse
March 21st, 2002, 04:23 PM
Totally correct, Jubby. And moreover I was tired when I wrote that. So don't listen to me too much.
I really sounded sarcastic, didn't I ? Sorry about that.
pom 0]
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.