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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

KeyPress Question + set selection focus

Status
Not open for further replies.

CarddassX

Programmer
Apr 2, 2002
9
US
I'm trying to emulate the old computer feel in my flash file by having the user press any key to begin. I have my movie stopped at frame 1 and want the user to go to frame 2 only when he/she presses any key. It seems fairly simple in theory, the only way I can think of accomplishing that is to code the same function for every key on the keyboard. Any suggestions? Is there any way of replacing that h with an operator that means 'any key'?

----------------------------------------------
on (keyPress "h") {
if (keyDown == true) {
gotoAndStop (2);
}
}

----------------------------------------------

I'm also trying to make an input text field have focus on screen so that keypress commands waiting in the mist won't be activated.
I applied the following coding to the movie instance with the input text field inside of it.:
----------------------------------------------
onClipEvent (mouseDown) {
Selection.setFocus(urlinputbar);
}
----------------------------------------------

Any help for either of my problems would be much appreciated. Thanks

-Cardy



Thanks

-Cardy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top