Key.ENTER Is Not Working
hi i have been working on this sample code in flashmx 2004 here every key code is working except Key.ENTER.I can trace all key code events except Key.ENTER. Is this my keyboard fault or this problem really exists? Can anyone help me how to detect enter key press. Thanks in advance. This is the flashmx 2004 sample code i tried.
code: var DISTANCE:Number = 5; var keyListener:Object = new Object(); keyListener.onKeyDown = function() { switch (Key.getCode()) { case Key.LEFT : trace("left Pressed") car_mc.onEnterFrame = function() { this._x -= DISTANCE; }; break; case Key.UP : trace("up Pressed") car_mc.onEnterFrame = function() { this._y -= DISTANCE; }; break; case Key.RIGHT : trace("right Pressed") car_mc.onEnterFrame = function() { this._x += DISTANCE; }; break; case Key.DOWN : trace("down Pressed") car_mc.onEnterFrame = function() { this._y += DISTANCE; }; break; case Key.ENTER : delete car_mc.onEnterFrame; trace("enter Pressed") break; } }; Key.addListener(keyListener);
FlashKit > Flash Help > Flash ActionScript
Posted on: 12-19-2005, 04:31 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Key.ENTER Is Not Working
hi
i have been working on this sample code in flashmx 2004 here every key code is working except Key.ENTER.I can trace all key code events except Key.ENTER. Is this my keyboard fault or this problem really exists? Can anyone help me how to detect enter key press.
Thanks in advance.
This is the flashmx 2004 sample code i tried.
ActionScript Code:
var DISTANCE:Number = 5;
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
switch (Key.getCode()) {
case Key.LEFT :
trace("left Pressed")
car_mc.onEnterFrame = function() {
this._x -= DISTANCE;
};
break;
case Key.UP :
trace("up Pressed")
car_mc.onEnterFrame = function() {
this._y -= DISTANCE;
};
break;
case Key.RIGHT :
trace("right Pressed")
car_mc.onEnterFrame = function() {
this._x += DISTANCE;
};
break;
case Key.DOWN :
trace("down Pressed")
car_mc.onEnterFrame = function() {
this._y += DISTANCE;
};
break;
case Key.ENTER :
delete car_mc.onEnterFrame;
trace("enter Pressed")
break;
}
};
Key.addListener(keyListener);
KeyPress Not Working For Enter, Backspace, Tab
Hi all,
I'm trying to capture certain keypresses and this is working for any alphabets/numbers that I press, but not for Enter, Backspace, Tab etc. However, if I click the mouse once and then press enter the event is detected. Any idea how I can being to detect enter, backspace without having to click my mouse even once.
I am running the file in the Authoring Environment.
Here's my code
_root.onEnterFrame = function(){
trace(Key.getCode());
}
Any help with this would be greatly appreciated!!!
Thanks,
Diablo
Pressing Enter Isnt Working...
Hi
Apologies if this question has been answered many times before -
I have a button which has the following code:
on (keyPress "<Down>"){
gotoAndPlay(2);
}
on (keyPress "<Enter>"){
nextScene();
}
So pressing Down will go to the next frame whereas Enter goes the next Scene.
For the life of me I cannot understand why pressing Enter does not work - I am using exactly the same code in a different part of the file where a movie clip stops and you have to press Enter to continue.
In the above code if I press Enter it acts like it doesnt understand the code and instead it goes to the next frame.
Any help on this I am confused.
Thanks
Detect ENTER Key Press Not Working
I need to have a PHP script have a variable passed to it when a flash button is either clicked or ENTER is pressed. This is my AS3 code so far:
Code:
stop();
search_button.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void
{
if(the_text.text != "")
{
navigateToURL(new URLRequest('search.php?search=' + the_text.text), '_self');
}
}
var enterListener:Object = new Object();
enterListener.onKeyDown = function():void
{
if(Key.isDown(Key.ENTER))
{
if(the_text.text != "")
{
navigateToURL(new URLRequest('search.php?search=' + the_text.text), '_self');
}
}
};
Key.addListener(enterListener);
When I try to save this I get errors though:
1120: Access of undefined property Key. Key.addListener(enterListener);
1120: Access of undefined property Key. if(Key.isDown(Key.ENTER))
Thanks anyone
Both CTRL+ENTER And PUBLISH Not Working
I downloaded a FLASH CS3 trial version. On my project, I imported 30 jpegs into my library and converted each to a symbol. When I pr
essed either CTRL+ENTER or PUBLISH, it works. When I added another 30 jpegs and converted to a symbol, both CTRL+ENTER and PUBLISH d
id not work.
When I tried to delete the jpegs and its corresponding symbols, both CTRL+ENTER and PUBLISH still did not work. Even if I reached on
e jpeg already, still did not work.
What is wrong?
Working With Enter Key - Reply ASAP Pls
Hi all,
I'm working with Actionscript 2.0. I am applying the following code
keyListener = new Object();
keyListener.onKeyUp = function() {
var keyCode = Key.getCode();
if (keyCode == 13) {
gotoAndPlay(1318);
}else {
gotoAndStop(1314);
}
};
Key.addListener(keyListener);
Problem I'm facing is that its not working with the enter key , however if i'm giving any other key code then its working. Infact if i'm giving the following code
keyListener = new Object();
keyListener.onKeyUp = function() {
var keyCode = Key.getCode();
if (keyCode == 13) {
gotoAndPlay(1318);
}else if (keyCode == 32) {
gotoAndPlay(1318);
}else{
gotoAndStop(1314);
}
};
Key.addListener(keyListener);
Then its working fine but only in the case of else if part ( key Code==32, space bar ), but not with the enter key.
Please help.
Working With Enter Key - Reply ASAP Pls
Hi all,
I'm working with Actionscript 2.0. I am applying the following code
keyListener = new Object();
keyListener.onKeyUp = function() {
var keyCode = Key.getCode();
if (keyCode == 13) {
gotoAndPlay(1318);
}else {
gotoAndStop(1314);
}
};
Key.addListener(keyListener);
Problem I'm facing is that its not working with the enter key , however if i'm giving any other key code then its working. Infact if i'm giving the following code
keyListener = new Object();
keyListener.onKeyUp = function() {
var keyCode = Key.getCode();
if (keyCode == 13) {
gotoAndPlay(1318);
}else if (keyCode == 32) {
gotoAndPlay(1318);
}else{
gotoAndStop(1314);
}
};
Key.addListener(keyListener);
Then its working fine but only in the case of else if part ( key Code==32, space bar ), but not with the enter key.
Please help.
Text Fades With Enter But Not With CTRL-Enter
I have followed steps I've found in tutorials, but my TEXT does not fade when I run the web-page version (CTRL-Enter) even though it does fade when I just hit Enter inside Flash. (I have converted the text to Symbol -- both graphic and movie clip)
Images fade fine in both.
Is this something simple I'm blind to?
Input Text Field, "Enter" Key Not Working
hi,
I am working on a guestbook and right now when I type in the text field, the "enter" key works, however, once the message is submitted and displayed via php, the "enter" command is ignored, so everything is just one long sentence with no breaks. Can someone tell me how to fix this?
thanks in advance
Al
On(keyPress "<enter>") Not Working
I used the following code on a button on my stage and it seems to not be working what am missing?
Code:
on (keyPress "<enter>"){
call a function here();
}
Is there another way to acomplish what I'm looking to do here?
Why "if (Key.isDown(Key.ENTER))" Is Not Working
Code:
var keyListener:Object = new Object();
keyListener.onKeyDown = function() {
if (Key.isDown(Key.LEFT)) {
trace("test");
}
};
Key.addListener(keyListener);
The above code works perfect, but if i write ENTER instead of LEFT, it doesnt work, does anybody has any idea of whats going wrong?
Thanx
Ctrl+Enter Instead Of Enter In TextArea
Hi,
I'm creating a Flash instant messaging application (through XMPP protocol) and run into a problem. It isn't that important but I was quite upset that I wasn't able to solve it and I want to know if their is a solution =D
I have a TextArea chat input and a button to send the text, the TextArea is multiline and so captures the Enter key to jump one line... What I need is to send the message with the Enter key and jump with a Ctrl+Enter combination... My ideas were to disable the bubbling of the Enter key, trap it, and then manually assign the Ctrl+Enter combination to jumping the line in TextArea but couldn't find how to do all this...
I have to programm this application in AS2 but will be glad if you have an AS3 solution as well (to use later, learn and help others reading this thread
thnx,
Philip Seyfi, fs-studio.eu
Why Won't Key.ENTER Not Detect The Enter Key?
the subject says it all really... how do you detect the <enter> key with clip events? The ASCII code for Enter is 13 and i've tried it using key.getCode and Key.ENTER, both unsuccessful. I'm using a laptop (not that it should make a difference right?).
Does anyone know?
About ENTER Key
This is my problem:
I have 2 input text boxes and 1 OK button for validate the data introduced by the user.
If when introducing data in the first text box the user it presses the key ENTER, the program runs.
Is it possible to annul this effect of the key ENTER?
Thanks in advance,
ô¿ô kairox
Enter
I have several input text fields in a Flash MX .swf.
I want the Enter key on the keyboard to work in
addition to the buttons to the right of the fields.
Can I use a listener for this?
Simply adding a Key Press to the buttons doesn't do it.
mcpeko@flamencopeko.net
http://flamencopeko.net
Key.ENTER
Does anyone know how to covert the default keyboard selection key in flash from the "space bar" to the "enter key"?
Example:
When I am focused on a checkbox and press the "enter key" nothing happens, but when I press the space bar it turns the check on and off. This is the same for the buttons in my flash movie. I want to disable the space bar and use the enter key instead.
Enter Key
Lets say i want the insert point in the input text box go to the next one when i press the Enter key.
Hope someone could help me. Thanks
Key.ENTER
someListener = new Object();
someListener.onKeyDown = function() {
if(Key.isDown(Key.ENTER)) {
trace("Hit the right one");
} else {
trace("Wrong ***** !!!");
}
};
Key.addListener(someListener);
I have to hold the enter key, then hit another to make it work...
Whats the deal?
Enter
how can i get actionscript to tell a line in a dynamic text string to 'break', i.e hit the enter key and write on a new line?
Enter Key?
Sup everyone?
I have a problem with a login button. I want it to activate when someone clicks enter on the keyboard. Right now they have to select the Go button. Thanks for the help.
The Enter Key
ok, I KNOW I've seen this on here before, but for the life of me i can't find it..
I need to submit a form with the enter key.. I have this:
Code:
EnterKey = new Object();
EnterKey.onKeyDown = function (){
var _$key = Key.getCode();
if (_$key == 13) {
trace("works")
}
}
Key.addListener(EnterKey);
but i don't get the trace when I run it.. what am I missing?
Enter Key
hi All,
I've read numerous threads and still don't understand how to fix my prob. Sorry if this is repeating other threads...
I have an input field and I want the enter button to submit the input. As of now, when you hit enter, it clears the field and screws up the animation.
I think I need a listener, I'm just not sure of the syntax I need.
Can anyone help me?
Help With Enter Key And <br>
Hi guys,
I have an htmltext input field via the textarea component. When the user presses enter in the field it works fine. When I recall their input from the database and output it in flash it works fine.
the problem is, sometimes i need to output their input with php. the html does not read the enter key! is there an invisible identifier letting flash know there are enters pressed? if there is i can do a find and replace in php and change them to <br>'s on output...
any help would be much appreciated!
S
Key.ENTER
Does anyone know how to covert the default keyboard selection key in flash from the "space bar" to the "enter key"?
Example:
When I am focused on a checkbox and press the "enter key" nothing happens, but when I press the space bar it turns the check on and off. This is the same for the buttons in my flash movie. I want to disable the space bar and use the enter key instead.
Enter Key
Lets say i want the insert point in the input text box go to the next one when i press the Enter key.
Hope someone could help me. Thanks
What's Up With The ENTER KEY, Can Someone Help With It.
Hello everybody,
i have a Enter key problem (obvious). I searched up and down the net but got no useable result. the most common one was the following one.
Code:
var enterListener = new Object();
enterListener.onKeyDown = function() {
if (Key.isDown(Key.ENTER)) {
trace("enter key");
}
};
Key.addListener(enterListener);
this only works when i also press shift, so shift+Enter works.
Naturally i want to use the enter key only.
is there someone who knows this problem and knows how to do it properly.
thanx in advance.
Maxgrafx
ENTER Key
Hi,
I am making use of the ENTER key from my keyboard after typing the answer, and the score is obtained.
I referenced the "input text : insert_txt" and referenced the "Var: answer"
I dont undertand why the code is not working, when I press the ENTER key.
Thanks
U
Attach Code
var KeyObj:Object = new Object();
KeyObj.onKeyDown = function() {
if (Key.getCode() == 13) {
_root.insert_txt.text = "lascaux";
myScore += 25;
}
};
Key.addListener(KeyObj);
Enter, Please
How do I go about making a splash page with a "enter" button so that my viewers will have to hit the button to enter the site? I'm not sure about the code. Any help would be much appreciated!
Cheers!
Enter Key
How can I get a button to trigger by pressing a key on the keyboard.
In my case, I have an 'Enter' button that I want to invoke when the 'Enter' key is pressed on the keyboard.
Any direction would be greatly appreciated.
gkc
AS3 - Enter?
Hey, I'm rather new to Actionscript and I was wondering how could I make it so that when the user presses 'Enter' a function is carried out? Thanks in advance.
ENTER Key
Last edited by uxk8396 : 2007-01-11 at 11:53.
Hi,
I am making use of the ENTER key from my keyboard after typing the answer, and the score is obtained.
I referenced the "input text : insert_txt" and referenced the "Var: answer"
I don't undertand why the code is not working, when I press the ENTER key.
Thanks
U
ActionScript Code:
var KeyObj:Object = new Object();
KeyObj.onKeyDown = function() {
if (Key.getCode() == 13) {
_root.insert_txt.text = "lascaux";
myScore += 25;
}
};
Key.addListener(KeyObj);
Key.ENTER
someListener = new Object();
someListener.onKeyDown = function() {
if(Key.isDown(Key.ENTER)) {
trace("Hit the right one");
} else {
trace("Wrong ***** !!!");
}
};
Key.addListener(someListener);
I have to hold the enter key, then hit another to make it work...
Whats the deal?
Enter In XML
How do you insert and enter in XML? I need to show
"Go
to"
Enter Key Help
Hi guys,
I wonder if you can help this noob. I have managed to complete the following FILE but
want to tidy it up and add a few features.
Anyway, what i want to do is when the provision button is pressed in the above file,it outputs the contents of the text boxes into another dynamic text box. I want to be able to also do this when the 'ENTER' button is pressed on the users keyboard.
How would i go about do this and were would i put the code ?
Cheers guys.
Enter Button Help
Enter Button Help
Hey
I have made a intro but don’t know haw to make it so when some one clicks on the enter text they go to my main site
Ps I am a nooby so pleas explain it simply J
How To Do An Enter Button?
How do i make it so ppl can click on a word that says "enter" and they go to a desired page?
Thanks.
Nate
Hitting The Enter Key
Hello,
I have a movie clip and in that there is a point where the user needs to hit the 'enter' key to move in the movie clip timeline. For some reason using
on (keyPress "<Enter>") {
gotoAndPlay(20);
}
does not work when it is embedded in a movie clip. only if used on the main timeline.
Any thoughts or code that might help?
Thanks...........Rob
Enter In DynamicText
Hi! I have one problem:
I have DynamicText field with Mulitiline setting. And take text from XML date.
If it has enter inside, mean not one line, then the spaces
between lines are to large. If it's just one line, then it
makes anouther interval between lines. So, I can not set
equal properties for to types of texts. Please, what to do?
Alex.
How To Disable <ENTER> Key
Hi,
Is there a way to disable the <Enter> key on the keyboard using actionscript? In my movie I want the user to use arrows to navigate, but some users insist on trying to advance by pressing <Enter> on the keyboard and this makes them jump back to a different layer.
Please let me know how I can disable the <Enter> key! Any help is much appreciated.
Thanks
Glenn
Enter Like Klickstudio.com
http://www.klickstudio.com after loading. there is button enter.
that's movie or actionscript.
if actionscript. then how?
Enter Key Only Works Once
I have a search box in frame 1, logic to process a search in frame 2.
When I press the enter key, it goes to frame 2 (as it should). The actionscript then returns the playhead to frame 1.
However, when I press enter again, it remains in frame 1.
Any ideas on how to make it go to frame 2?
Thanks,
Rachel
I Wanna <Enter>
Hi,
I'm trying to call a function when the user either clicks a button OR when he/she hits the ENTER key on the keyboard. I've attached the following code
on (release, keyPress "<Enter>") {
myFunction();
trace("calling function now");
}
Clicking on the button is no problem. But hitting ENTER causes the play head in the movie to play, moving through subsequent frames, but it fails to call the function. In fact, it even fails to run the trace, in effect bypassing the keyPress in the button altogether. Why is Flash ignoring my button command and simply advancing the playhead? I'm publishing for Flash 5. Thanks.
Kevin
Exit And Enter
interface problem
example:
you are on a page called home...you click a button called bio...the info on the home page fades out or flys out the scree and then the info for the bio fades in or flys on to the screen...the catch is each section is a different swf file that loads in to the main file...
Enter Button Help
Can you please look at my .fla and tell me what I am doing wrong!
I want the "intro" scene to stop on its last frame.
And I want users to be able to move to the "dougland" scene when they click the enter button.
it was too big for this page w/o zipping it. but try to right click this and "save target as"
http://www.angelfire.com/retro/team...ndprototype.fla
THANKS SO MUCH FOR YOUR HELP!
-Doug
Using ENTER Instead Of A Button...
I have a set up now where a user enters something in an input field and then hits a button to submit their answer. On the buttonClip is all the actionScripting. Is there a way to set it up so that in addition to using the button, a user can also just input their answer and then hit ENTER for the script to run?....
Enter Vs Intro
Hi,
we are working in a simulation of a Software where the keys ENTER and INTRO (the key in the numeric Keypad) have different functions.
In the flash help said that the Key Intro have a Key code 108 we use Key.getCode() but two keys return the key code 13.
we want to know how identify when I press the Intro key and get the code number 108.
Enter Vs Intro
Hi,
we are working in a simulation of a Software where the keys ENTER and INTRO (the key in the numeric Keypad) have different functions.
In the flash help said that the Key Intro have a Key code 108 we use Key.getCode() but two keys return the key code 13.
we want to know how identify when I press the Intro key and get the code number 108.
Using The Enter Key As A Trigger
Hey,
i have several movies with dropdown boxes to select model numbers and bring up parts breakdowns for our customer service reps on our company Intranet. A request was made to be able to use the enter key to activate the current selection instead of having to press an onscreen select button.
I know you can check for keypresses, but i need help understanding how to implement this regadless of what is currently selected on screen.. For example, if they press enter, no matter if the combobox is selected or some other item onscreen is selected, the enter key will still trigger the current item in the dropdown to open the correct PDF file..
FLA's are available, but they are too large to post. If you need to see one, please email me at mrobinson@devap.com
thanks,
-myk
KeyPress <enter>
Hi,
i have 2 input boxes (with btns to put the code on) for 2 different searches and want the enter key to initiate the search in each case eg.
on (release, keyPress "<Enter>") {
//do this
}
how can i distinguish between the 2 searches, so if the user has just written in 1 of the boxes and hits enter that particular search is initiated. Currently if enter is pressed, the first of the searches is always initiated no matter which input box you type in.
any ideas would be appreciated
thanks
robin
|