Ten90Group
asked on
On Key Press troubles
I need a function in ActionScript that will allow me to press enter and make an instance of an object visible. This will not be attached to a movie clip or a button instance, as Macromedia seems to require. How do I do this?
ASKER
That returns the following error upon debugging:
Mouse events are permitted only for button instances on(keyPress "<Enter>"){
Mouse events are permitted only for button instances on(keyPress "<Enter>"){
Create a button. And put action script on it. Then hide it. (Alpha=0, or Visible=false..)
BR Dushan
BR Dushan
ASKER
This does not work. I hit enter, and nothing happens.
ASKER
If this would work better for you, may I have your AIM or Yahoo screen name? I need this resolved ASAP for a client. Thanks.
ASKER
OK, here is my issue now. It seems that this function works for every key EXCEPT enter. I have tried typing <Enter>, <enter>, and <ENTER> and none work. Is there maybe a disabled setting somewhere?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This does not work, oddhours. It is as if Flash does not like the enter key at all.
ASKER
This did work for other keys, such as the LEFT key.
you can replace the code:
trace("ENTER key pressed");
with whatever you like for example:
instanceNameToShow_mc._vis ible = true;
trace("ENTER key pressed");
with whatever you like for example:
instanceNameToShow_mc._vis
my messenger ID is same in my profile's email address. But now I'm in home. I will at office after one hour.
BR Dushan
BR Dushan
ASKER
OK, heres the deal.
I tried oddhours' method, and it did not work. I then started searching for settings which would enable the enter key. I found a setting in the Publish Preview window called Disable Keyboard Shortcuts, located under Control. When this option is checked, the Enter key works. Only problem is now how do I make sure that this setting is included in the Publish settings?
I tried oddhours' method, and it did not work. I then started searching for settings which would enable the enter key. I found a setting in the Publish Preview window called Disable Keyboard Shortcuts, located under Control. When this option is checked, the Enter key works. Only problem is now how do I make sure that this setting is included in the Publish settings?
ASKER
Woo hoo! Problem fixed! Thanks everyone for your help!
Congrats!
instance1.visible= true;
}
BR Dushan