[F8] Flash --> On KeyPress Help
I am making mobile in flash ... and i have done buttons that i can click with mouse , and when i click them the light will open after few seconds it will close.... and i want to do it that i can click with keyboard too , keys like 1 , 2 , 3 ... , Enter , Left , * , etc... and i dont know how to do it ... in fact i have done to press it but i have a problem with it ... here is a code i have put in button :
Code: on(press){ this._parent.button.gotoAndPlay(1); this._parent.Light.gotoAndPlay(1); gotoAndStop(2); }
on (keyPress "<Space>"){ this._parent.button.gotoAndPlay(1); this._parent.Light.gotoAndPlay(1); gotoAndStop(2); }
on(release){ gotoAndStop(1); }
these others are working good , but this on(keyPress "<Space>") isnt working !!
.Thnx.
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-25-2007, 06:16 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Flash MX With Keypress
I'm trying to make an interactive drumkit where when you press a button, a sound is triggered.I have made a movie and turned off visibility. This is the actionscript that is attached to it:
onClipEvent (keyDown) {
if (Key.getcode() == 65) {
_root.Sounds.gotoAndStop("a");
} else if (Key.getcode() == 66) {
_root.Sounds.gotoAndStop("b");
} else if (Key.getcode() == 66) {
_root.Sounds.gotoAndStop("b");
} else if (Key.getcode() == 67) {
_root.Sounds.gotoAndStop("c");
} else if (Key.getcode() == 68) {
_root.Sounds.gotoAndStop("d");
} else if (Key.getcode() == 69) {
_root.Sounds.gotoAndStop("e");
} else if (Key.getcode() == 70) {
_root.Sounds.gotoAndStop("f");
} else if (Key.getcode() == 71) {
_root.Sounds.gotoAndStop("g");
} else if (Key.getcode() == 72) {
_root.Sounds.gotoAndStop("h");
} else if (Key.getcode() == 73) {
_root.Sounds.gotoAndStop("i");
} else if (Key.getcode() == 74) {
_root.Sounds.gotoAndStop("j");
} else if (Key.getcode() == 75) {
_root.Sounds.gotoAndStop("k");
} else if (Key.getcode() == 76) {
_root.Sounds.gotoAndStop("l");
} else if (Key.getcode() == 77) {
_root.Sounds.gotoAndStop("m");
} else if (Key.getcode() == 78) {
_root.Sounds.gotoAndStop("n");
} else if (Key.getcode() == 79) {
_root.Sounds.gotoAndStop("o");
} else if (Key.getcode() == 80) {
_root.Sounds.gotoAndStop("p");
} else if (Key.getcode() == 81) {
_root.Sounds.gotoAndStop("q");
} else if (Key.getcode() == 82) {
_root.Sounds.gotoAndStop("r");
} else if (Key.getcode() == 83) {
_root.Sounds.gotoAndStop("s");
} else if (Key.getcode() == 84) {
_root.Sounds.gotoAndStop("t");
} else if (Key.getcode() == 85) {
_root.Sounds.gotoAndStop("u");
} else if (Key.getcode() == 86) {
_root.Sounds.gotoAndStop("v");
} else if (Key.getcode() == 87) {
_root.Sounds.gotoAndStop("w");
} else if (Key.getcode() == 88) {
_root.Sounds.gotoAndStop("x");
} else if (Key.getcode() == 89) {
_root.Sounds.gotoAndStop("y");
} else if (Key.getcode() == 90) {
_root.Sounds.gotoAndStop("z");
}
}
Every frame of the movie clip has a different sound. Whenever I try pressing the button, it does nothing. Sounds is the movie clip. Can anyone tell me why it doesn't work?
EDIT: Nevermind, it doesn't work. I get this:
WARNING: Duplicate label, Symbol=Sounds, Layer=Layer 1, Frame=7, Label=e
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 2: There is no method with the name 'getcode'.
if (Key.getcode() == 65) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 4: There is no method with the name 'getcode'.
} else if (Key.getcode() == 66) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 6: There is no method with the name 'getcode'.
} else if (Key.getcode() == 66) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 8: There is no method with the name 'getcode'.
} else if (Key.getcode() == 67) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 10: There is no method with the name 'getcode'.
} else if (Key.getcode() == 68) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 12: There is no method with the name 'getcode'.
} else if (Key.getcode() == 69) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 14: There is no method with the name 'getcode'.
} else if (Key.getcode() == 70) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 16: There is no method with the name 'getcode'.
} else if (Key.getcode() == 71) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 18: There is no method with the name 'getcode'.
} else if (Key.getcode() == 72) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 20: There is no method with the name 'getcode'.
} else if (Key.getcode() == 73) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 22: There is no method with the name 'getcode'.
} else if (Key.getcode() == 74) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 24: There is no method with the name 'getcode'.
} else if (Key.getcode() == 75) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 26: There is no method with the name 'getcode'.
} else if (Key.getcode() == 76) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 28: There is no method with the name 'getcode'.
} else if (Key.getcode() == 77) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 30: There is no method with the name 'getcode'.
} else if (Key.getcode() == 78) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 32: There is no method with the name 'getcode'.
} else if (Key.getcode() == 79) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 34: There is no method with the name 'getcode'.
} else if (Key.getcode() == 80) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 36: There is no method with the name 'getcode'.
} else if (Key.getcode() == 81) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 38: There is no method with the name 'getcode'.
} else if (Key.getcode() == 82) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 40: There is no method with the name 'getcode'.
} else if (Key.getcode() == 83) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 42: There is no method with the name 'getcode'.
} else if (Key.getcode() == 84) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 44: There is no method with the name 'getcode'.
} else if (Key.getcode() == 85) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 46: There is no method with the name 'getcode'.
} else if (Key.getcode() == 86) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 48: There is no method with the name 'getcode'.
} else if (Key.getcode() == 87) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 50: There is no method with the name 'getcode'.
} else if (Key.getcode() == 88) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 52: There is no method with the name 'getcode'.
} else if (Key.getcode() == 89) {
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 54: There is no method with the name 'getcode'.
} else if (Key.getcode() == 90) {
Total ActionScript Errors: 27 Reported Errors: 27
Flash + IE + Ctrl+B Keypress
Hi,
Does anyone know of a way to disable IE's default handling of ctrl+Key combinations, and passing these directly to flash? I've just spent a full day trying to get this to work without any luck.
For example, ctrl+B pulls up the favorites manager in IE if flash is focussed.
Thanks,
F.
KeyPress Not Working In Flash MX 2004
Anyone know why I can't get keyPress "<enter>" to work in the Flash MX 2004? I had it working fine in Flash 5.
Here's my old code:
code:
on(release,keyPress "<Enter>") {
---- code snipped ----
}
Release works fine, but pressing "Enter" doesn't any longer.
How To Simulate A Keypress In Flash Actionscript 2.
I have the following code in my Flash AS2 project. The trace works fine and the trace tells me what key was pressed. What I need to do though is actually simulate the keypress. (I have a datagrid object and need to make the focus go down one on the list). So I want to simulate pressing key 38 but am not sure how.
KeyListener = new Object();
KeyListener.onKeyDown = function(){
trace("key pressed" + Key.getCode());
}
Key.addListener(KeyListener);
(Just a little background. I have a third party drag&drop datagrid component. It doesn't have anything built in to automatically scroll down with the scroll bar. So I want to press the down arrow for the user)
Keypress On Componets (yet Another Item Flash Can't Do)
yet again, something that is one line of code in other languages that flash can't do....
1. Write component
2. I want to respond to a keypress to a movie clip or other item in the component (say an input field or other movie clip)
this.onKeyPress only works when defined from root. i.e. mc.onKeyPress() = function....
How the fukkk am I do to this from a component?
And I don't want a keylistener, as I don't want one in every class/component. And no, I don't want code on the root. The point is to have an encapsulated compoent.
Can this be done, or is flash a crap development tool. Time to use Java applets, Flash soooo sucks at anything other than making pretty pictures.
Keypress In Flash MX 2004, Writing To Files
Does anyone know how to do either of these? I need to figure out a way for a button to check for someone to push the "c" key.
I also want to figure out how you can have flash write to a text file, if possible.
Thanks for any replies,
Spidy
Simulate Windows Keypress Event In Flash
I have a problem in Flash ActionScript.
I need to create an On Screen Keyboard like the On Screen Keyboard that comes with Windows XP. It should simulate the actualy Keypress event so that it can be used to type in any application(say notepad).
Can I create such an event in Flash Actionscript which generates a Keypress event.
Using A Keypress Button To Navigate Flash Projector Movie
Hi, Any help will be greatly appreciated. What I am trying to achieve is to have one key -lets say the letter 'n', to control my flash presentation- which has different sections that need to go in order as the presenter speaks so it will serve basically as a next button. I don't want a mouse running around the screen pressing buttons as its a visual presentation on a huge projector screen! I have tried this using an invisible button and this As:
on (keyPress "<Space>") {
gotoAndStop("next Scene", 1);}
which does'nt work and I havent been able to figure out why! If I could just get the key press to work even to goto the next frame then I can make this work but no luck there either.
I can get key presses to work if I use a movie clip;
onClipEvent (keyDown) {
if (Key.isDown(78)) {
_root.myMC.gotoAndPlay(2);}
I'm not sure if this will work using the same key for all my events? Surely it will just keep playing the same movie clip over and over. If anyone can shed some light or knows of a better way to achieve this please help, I have never had to use anything other than mouse navigation so I am rather clueless about this side of Flash.
B
KeyboardEvent Handler Added, But Flash Still Handles Keypress Itself
I'm currently trying to write some code to deal with screen navigation, among other things. When a simple button 'btnA' has focus, I want to have a down arrow keypress take the user to 'btnC'. The example code is below.
What ends up happening though is that the focus is correctly placed on btnC, but then Flash seems to handle the key down navigation itself and then moves the cursor down to btnD.
Thoughts? Is there any way to prevent Flash from handling the down arrow navigation after I've handled the keyboard event?
Attach Code
btnA.addEventListener(KeyboardEvent.KEY_DOWN, btnAKeyHandler);
function btnAKeyHandler(event:KeyboardEvent):void
{
if (event.keyCode == 40) // arrow down
{
stage.focus = btnC_btn;
}
}
On( KeyPress "1") In Flash Mx
hey guys,
i have this question... before i can create a btn and give it a
on ( keyPress "1" )
{
trace( "1 is pressed" );
}
but now i want to build a list of btns dynamically. and i try to do a
BTN.onKeyPress, and onKeyUp and onKeyDown... but none of those work... please advice
thanks in advance
justin
Keypress F5, F6, Etc
How can I get the keypress event of F5, F6, etc... I know I can't do it directly with flash, but maybe Javascript... kinda lost here...
On KeyPress Help
Anyone know how I can have Flash recognize the user pressing the F4 key for the on keyPress event?
Keypress
I'm making a personal "babybanger" game for my son, to teach him the meaning of letters, numbers and shapes...here goes:
I have movies (A-B) with each 4 frames containing different pictures which start with the current letter i.e B = Ball or Baby....., each frame has a stop action.
In my main scene I have a button with this script:
on (keyPress "b") {
_root.b.swapDepths(1);
tellTarget ("b") {
play();
}
}
So when he hits the "b" key it will play the next frame of the B movie.
The problem being that the B movie keeps playing through all the frames as long as he holds down the key, I just want it to play one frame every time he hits the "b" key.....I could really use an action with :
on (keyRelease "b") instead but can't seem to find out how.
KeyPress Help Please
I am creating a piano swf and upion the press of a key I want the button the the piano look like it is in its down state. I have placed the movieclip and given it the instance name "KeyPress1" on the stage the gave it an alpha value of "0" and then placed the following script on it.
on(keyPress "q") {
KeyPress1._alpha = 100
}
And that works except that when I release he key "q" I want the movieclip instance to change back to a "0" value and therefore not be visible and furthermore I want to make sure that while the key "q" is being pressed that the alpha value stays at "100"
How can I accomplish this? Somebody please help
Thanks in advance,
Josu
Keypress
how do i detect keypress of numbers like 3. I want to put on a frame with a stop action , a movie clip turns invisible, and a action where when you press 3, that movie clip turns visible again.
thanks.
On Keypress....
Hi all, I'm new at the flashkit-forums.
I've surfed around flashkit a lot to have a look at some sources and I learned a lot of them.
I'm certainly not a flash-expert, I'm just in a learning fase. I think it is a great programming language for web applications.
I made my first game (well actually my second, but the first one isn't really worth mentionning), and I have a little problem with it. I added it to the movies--> games -section of flashkit (although it didn't get approved yet (how long does that take normally?)).
It's a typing test game I made just to get a bit the hang of actionscripting. It tracks wich key is pressed and if it is the same key as the letter apearing on the screen then the score goes up.
No some people told me that a good adition would be that the score goes down when someone presses a wrong key. I just don't see how to implement that.
Here is how I made it: I have 26 frames and in each frame there's a letter I converted to a button. That button tracks if the key is pressed of the letter wich appears on the screen. If randomly goes to another frame (with another letter)... There's a timer included wich ends the game after 30 seconds.
Here is the code I used for tracking the key:
Code:
on (keyPress "a"){
_root.score++;
gotoAndPlay(random(26)+2);
}
I tried adding the following to let the score goes down when a wrong button is pressed but it doesn't work off course:
Code:
on (keyPress !"a"){
_root.score++;
}
Anybody has any idea on how I can implement such thing?
Thanks in advance,
greets Rob
(I attached the source-code of my game)
Keypress Help
Ok im doing a project that it set up like a video game, and want to make it two players... I have all the coding for the question generator done, but how can i go about using key strokes for contestants to "buzz in" on my game? And to also keep a tally of thier score.
Thanks any help would be appreciated!
KeyPress
I would like that this function would also be executed when i press a Key, how can i do this?
Thanks for any help.
JGraca
a1.onPress = function() {
mov1(a1, 1);
gotoAndPlay(17);
};
Keypress
can someone help me with this, just tell me what to put inside the condition
if ('Alt + Shift is pressed'){
...
}
thanks
MaX_BoY
On KeyPress In An Exe?
I'm trying to have an invisible button in a flash projecter take you back to a scene on keyPress.....its not working....does it not work in an exe?
also, is it possible to use the F1 key?
any help appreciated...
Keypress Help
Here is what I want,
I want my movie to play till the end, then stop. After it stops, I want to be able to press enter, which, in turn, would send it to the next scene. I tried the following, but to no avail. Any help would be GREATLY appreciated.
--------------
stop();
on (keyPress "<Enter>") {
gotoAndPlay(Slide2, frame 1);
}
--------------
Slide2 = Scene 2
Also, I did name my frame instance on Scene 2 "frame 1". So that is not the problem. Thanks in advance
On Keypress Help
what is the code word for if they keypress one of the numbers at the top of the keyboard.
Thanks
On (keypress)
Hello,
I have tried to implement on (keypress) and it just has not worked I have a button on the main timeline with the following code...
code:
on (release, keyPress "<Enter>") {
resultSet = "Loading...";
loadVariablesNum(varPath + "/asp/stu_login.asp", 0, "POST");
}
on (release, keyPress "<Enter>") {
gotoAndPlay(148);
}
When I go to test it pressing the enter key does not advance the movie.
Keypress Help
Ok, does anyone know why this doesn't work?:
Code:
_root.currentwep = "Handgun";
//make weapons changeable
if (Key.isDown(Key.SPACE)){
_root.currentwep = "Shotgun";
}
I don't understand why it wont work when in previous games ive made it has worked. Anyway, thx.
On(keypress...
Is it possible to use other then the predefined keys for this command? For instance Command I. If not is there a work around?
Thanks in advance for any help
Keypress Help
hey, i know that you can use the keypress with up,down,left,right and some other buttons,
but what is the script for normal letters, e.g. a, s, d, w
any help would be good, thanks
jason
Keypress
could anyone help me, basicaly im using this script to make a car go forward when you press the UP button.
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
speed += 1;
}
the problem is that i would like to change it so that you press the W button instead.
can anyone help
jaosn
KeyPress
I have this code on a button in a project:
on (rollOver) {
containerA.unloadMovie();
}
on (release, keyPress "<Right>") {
trace("The Right Arrow key was pressed");
clearInterval(timer);
goToAndPlay("81start");
containerA.attachMovie("PlayStatSymbol", "PlayStatSymbolA",1);
script50.stop("50.mp3");
}
The "keyPress" part does not work. So I took this code and put it into small file (attached) and it works fine. Any idea why it won't work in my other file?
KeyPress
What is wrong with this keyPress command?
Code:
def.onEnterFrame = function(){
x4 = this._x
y4 = this._y
y5 = y4
x5 = x4
x5 += 46
y5 += 40
y4 -= 40
if ((((guy._x > x4) && (((guy._y > y4)) && ((guy._x < x5))) && (guy._y < y5)))) {
if (keyPress "1") {
def.play();
}
}
};
dont mind the part in bold its a substitute for a hitTest command.
On Keypress...
Hi,
I tried to make a page with a very little flash movie, height=1 width=1
I wanted to make it possible to press a key on a page and there will be an other page loaded. So people will be be quicker on browser through the website.
But it doesn't work, because you have to select the movie first (almost impossible when the movie is 1 by 1 px) before you can press a key. Is there a way to avoid this? I really don't want to make a movie wich you first have to select before you can use the shortkeys
the page is located here:
http://bcounter2.techroll.nl/
The flash movie will only appear when you are logged on:
username: Kaffa
password: qwerty
its located under the image with the text "jouw profiel" above it.
on the button in the movie I have:
Code:
on (keyPress "b"){
getURL("index.php?p=bewerk_profiel", "_parent")
}
on (keyPress "p"){
getURL("index.php?user=" + user, "_parent")
}
on (keyPress "u"){
getURL("index.php?p=upgrade_profiel", "_parent")
}
on (keyPress "c"){
getURL("index.php?p=casino", "_parent")
}
on (keyPress "s"){
getURL("__________allpages/shoutbox/_shoutbox_add.php?user=" + user, "shoutbox")
}
on (keyPress "r"){
getURL("JavaScript:radio_stream(220,305)")
}
on (keyPress "l"){
getURL("index.php?action=log-out&redirect=1", "_parent")
}
On(keyPress) Bug?
I had a scroller that was working perfectly using the on (keyPress "<Down">) script. Then it just stopped working. I dismantled the script and the button and re-did the whole thing, but still no success.
Is there some kind of bug at work here? Has anyone else ever experienced an event handler just dying like that?
[F8] Keypress
I have build a lot of simulations in captivate and this time it’s just not cutting it, so I have to bring it into flash for the interactivity. JOY
Here is what I’m trying to do. I want the user to have to hold down ctrl while pressing the down key to have the move play; they will probably have to do this five times. So is it possible to handle multi key presses in flash?
Thanks in advance
Drizzle
Keypress
If I want to use the arrpw keys to move an object, there seems 3 ways top do it.
1 uses on(kepress..), 1 uses getascii key amd the other uses an event handler.
What is the difference between the 3
Keypress
If I want to use the arrpw keys to move an object, there seems 3 ways top do it.
1 uses on(kepress..), 1 uses getascii key amd the other uses an event handler.
What is the difference between the 3
Keypress
Hi experts,
Is there an alternative to using 'Keypress' when detecting keyboard actions? The problem is with 'keypress' only detecting one key at a time - if one is making a game for example, with keys to detect movement and shooting, ideally you would want it to detect more than one keypress at a time so you can move and fire at the same time without one interrupting the other.
Thanks in advance,
ADE
Keypress
Hi,
I am very very new to flash but coming along alright. I was wondering if there is a simple way to know when a key has been pressed. I dont care which key it is, I just want to know a key have been pressed on the keyboard
Thanks
[CS3] Keypress
I am pretty new to flash and now I having a hard time getting any further. This a class project I am working on.
Right now the program responds to key press but I want a pause between key press to avoid just flying through the whole thing.
The FLA can be found at
http://www.geocities.com/islamicgames/kalpha1.fla
Thanks
Keypress
If I want to use the arrpw keys to move an object, there seems 3 ways top do it.
1 uses on(kepress..), 1 uses getascii key amd the other uses an event handler.
What is the difference between the 3 ?
Any Way To Allow One Keypress OR Another?
If I have four buttons that can be clicked in my scene, is there any way to allow either "1" OR "a" to control the first one, "2" OR "b" for the second, etc?
I know I can combine different mouse events:
Code:
on (release, keyPress "1") {
gotoAndPlay(2);
}
... where the comma essentially says on release OR when pressing "1".
But when I do different keyPresses:
Code:
on (release, keyPress "1", keyPress "a") {
gotoAndPlay(2);
}
to say on mouse release OR when pressing "1" OR when pressing "a"... I get a duplicate event error. I've tried using || and various other things, and none of my efforts or searches have resulted in anything.... What would the syntax be for this? Thanks!
Keypress Fun..
Hi, i`ve made a simple character and used the key listener to get him responding to the keyboard (move left, right, up down, punch and kick). But, when i press and hold a key to move him there is a delay (he moves then waits then continues to move) - can i get rid of that? Also, there is a two-frame walk-cycle and when he moves left or right i want it to play continuously - but it doesn`t, it plays only once unless i keep rehitting the move key. Is there a known issue with this or a workaround for it?
Any help is greatly appreciated always, thanks!
More Keypress Fun
I have a car symbol which is moved around the stage using the UP, DOWN, LEFT and RIGHT arrow keys. The movement is working fine, but I want the car to be correctly orientated to the direction it is moving. I have acheived this when moving up/down by changing the yscale value, but cannot achieve the same when moving left or right. My code is as follows:
Code:
onClipEvent(enterFrame) {
_global.speed = 5;
if (Key.isDown(Key.UP)) {
this._y -= _global.speed;
this._yscale = 100;
}
if (Key.isDown(Key.DOWN)) {
this._y += _global.speed;
this._yscale = -100;
}
if (Key.isDown(Key.LEFT)) {
this._x -= _global.speed;
}
if (Key.isDown(Key.RIGHT)) {
this._x += _global.speed;
}
}
Any help would be most appreciated.
KeyPress
I'm creating a presentation (like PowerPoint). I would like to have my points come in with a differnt effect one at a time when I press the down arrow and then go to the next slide when I press the right arrow. Do I need to make each point in a separate .swf file and load each file on press? But I would like to have all my points stay on screen untill I go to the next slide. Is this possible? I'm using the McTween pluging to control my effects, I don't know if you need to know that or not, but I am.
-Thanks
On KeyPress How To?
Hi,
I would like to attach a movieclip from the library when I press the keyboard key "A". (or any other key for example)
I can't get ot to work, Please help me!!
I am using it this way:
on (keyPress "<space>"){
_root.attachMovie("myMovie_mc", "newmyMovie", _root.getNextHighestDepth());}
Keypress Help
hello,
I am completely stuck, as a newby to actionscript, yet trying to undertake in my eyes an impossible task, maybe you can help!
what i want to do is this. I have designed an animated alphabet- now i want to attatch then to keys of the keyboard so when you press the letter then on the screen it pops up. Then if left idle for 15 seconds fades out to the blank screen again. So i have all these individual animated letters as movie clips, i just need to know how to script the whole thing together!
if anyone has any info or can reffer me to a good tutorial i would be forever grateful!
thanks.
Help With Keypress
On a webpage I have a .swf that has a usernamebox, a passwordbox and a submit button. How could I get it when the password box is active (instance name pass) and the enter key is hit, It will either press the submit key or it will trigger the following code:
Code:
dataOut.user = this._parent._parent.user.text;
dataOut.pass = this._parent._parent.pass.text;
dataOut.send("http://test.DOMAIN.net/login.php", "POST");
this._parent._parent.msg.setStyle("backgroundColor", 0x003399);
this._parent._parent.msg.setStyle("borderStyle", "none");
this._parent._parent.msg.setStyle("color",0xffffff);
var dataOut:LoadVars = new LoadVars();
var dataIn:LoadVars = new LoadVars();
dataIn.onLoad = function() {
if (this.login=="1") {
this._parent._parent.msg.text = 'Welcome ' + this.username + '!';
} else {
this._parent._parent.msg.text = 'Login was not successful, please try again.';
}
}}
On Keypress
Im trying to make a reproduction of the Helicopter game for one of my pals, but instead of using the mouse i would like to use the spacebar.
How would I do this?
I have about 2 lines of code and now Im stuck...
ty for all the help in the past with tutorials btw.
if someone could give me a boost up it would be really appreciated.
On(keypress....) Help
I know this isn't secure, but for my purposes it accomplishes what I need.
I have an input field with and instance name of mytext and var pass (type: input). Below it I have created a button with the following actionscript:
quote:on (press, release, keyPress "<Enter>") {
if (pass == "1556"){
gotoAndStop("main");
}else{
error_msg = "Wrong. Please try again."
}
}
The ENTER key, however, does not seem to respond.... any ideas as to why? Do I have to somehow tie the button and input field together?
Keypress Help Please
hi i have mx 2004 and would like to know how to make a keypress sctipt for example when key a is down trace ("whatever")
please help thanks
louis.
KeyPress
how add to this code keyPress "<Enter>" ?
submit.onRelease = function() {
getURL("https://bla.bla.bla", "_self", "POST");
}
stop();
regz
elefen
|