AS3.0 :: Go To Next Question / Frame? (keyboard Key)
Feb 6, 2010I would like to know what a.s. should I write to go to next question when I hit a keyboard key.
View 3 RepliesI would like to know what a.s. should I write to go to next question when I hit a keyboard key.
View 3 RepliesHow do you press a key (like "L") and go to the next frame?
Which event must I pick?
I assume it's something like: stage.addEventListener(Keyboard., but after that I don't know what to do.
This is for AS 3.0 by the way.
In frame 1 I set a keyboard handler on the frame:
stage.addEventListener(KeyboardEvent.KEY_DOWN, moveRusty);
moveRusty() moves an icon back and forth when the arrow keys are pressed - very simple. From frame 1 Flash proceeds to frame 2 where the main action takes place - rusty moves just fine. When he reaches a certain point I gotoAndPlay frame 3 which sets rusty's visibility to false. A button in frame 3 has gotoAndPlay frame 2 where everything is reset and Rusty is free to move.
The problem is, Rusty stops moving when we go back to frame 2 from frame 3. I put in a trace statement into the keyboard handler and it never gets hit. Now the REALLY weird part is that if I move the focus from the flash window to any other window and back again, things start working. From then on, everything works fine until I go to frame 3 and then back to frame 2 via the button in frame 3.
What kind of behavior would Adobe build in so that keyboard handlers only worked after change focus away and then back?
I have 2 scenes. In both scenes, I have a movie clip that moves via keyboard control. If the goto next scene is triggered by the movie clip in the first scene the keyboard control works in the second. However, if I use a button to move to the next scene then there isn't any control over the movieclip in that scene. I've traced the keyCode in the second scene and it is picked up but the switch statement doesn't run. I'm migrating to Actionscript 3.0 and updating something I created in 2.0. I would like to do it without writing a class.
[Code]...
When using a notebook and I have remarked that I cannot enter numerical character with shift + a letter to enter number.Is this a bug in flash ? How to circumvent this ?
View 2 RepliesHow do? Edit the field with numeric keypad, not a full keyboard my code: <s:TextInput text="{TransactionObject.cartao}" id="item" restrict="0123456789" /> app for Android and playbook
View 2 RepliesI get an error while extracting the asdoc of my flash professional project:
Code:
C:...Main.as(33): Spalte: 73 Fehler: Access of possibly undefined property D through a reference with static type Class.
private var moveRightArray:Array = new Array(Keyboard.RIGHT, Keyboard.D);
^
C:...Main.as(33): Spalte: 73 Fehler: Access of possibly undefined property D through a reference with static type Class.
private var moveRightArray:Array = new Array(Keyboard.RIGHT, Keyboard.D);
[code]....
I have my flash on multiple scenes, and would like to play an animation when clicking on the navigation button before switching to a different scene.
I'm halfway to accomplishing this.
Here is what i used
Code:
_root.gotoAndPlay("changepage1");
_root.onEnterFrame=function(){
if(this._currentframe=="changepage2"){
[Code]....
The above code is on a blank keyframe. Changepage1 is the start of the animation and Changepage2 is the end of the animation.
Upon clicking the navigation button it plays the above scenes.
However it doesn't change scenes to scene "Home2".
What command do I enter for the movie to rewind to first frame on entering a certain frame / stopping in a frame?It's my first time using Flash, and I'm working on a double menu (second menu has a "close" button, where I want to get back to the first menu).
View 5 Repliesi have a movieclip on stage. it has 3 frames but is stopped with "stop():" so it only shows the first frame on mousedown i want it to play frame 2 for a duration of 1 frame then frame 3.
View 3 RepliesI hope I can ask this correctly. I'll paraphrase.
press_mc.onRelease = function(){
mover2_mc.play()};
This is a snippet of some code I'm working on. Currently I have a mc that you press that plays another mc. That mc that reacts has 5 frames, each frame with stop(); on each frame. I do a normal play code because it lets me play through and cycle back to frame 1 after frame 5 (so if I click the mc it eventually cycles back to the first frame and starts the process over again). If I do a nextframe it stops at frame 5, so that's why I use play.
press_mc click on it and it tells mover2_mc to advance a frame and recycles back to frame one to redo the process.Can I tell press_mc to play and skip a frame or to have it play a list of frames that I tell? I can't do a _currentframe +2 because it'll halt at frame 5.
I can't figure what's the problem with the KeyboardEvent . I can't move the ship with keyboard. I have a ship on the stage .
[Code]...
how to change the focus of movieclips and buttons when I press the arrow keys of the keyboard. Its kind like the tab navigation but with de arrows keys, in the four direcctions. This flash app i'm developing has to be handled 100% with the keyboard.
View 2 RepliesI'm trying to write a simple counter. UP or Space increments a number and DOWN decrements. It's just one big number in the middle of the screen. A bell rings on an increment and I have added code to go full screen on mouse click.[code]...
View 1 RepliesI'm using a UK keyboard (where the " and @ signs are switched) and firefox to access my flash movie and when I press the @ sign on the keyboard, it will input a " sign.
View 1 RepliesWell i've used flash a bit but i never really messed with sounds. I want to make kind of a drum tool fun thing that can play sounds, so i need to know how to make a sound play when you press a letter or buton on keyboard
View 1 RepliesWell basically I've got this one frame in my animation. It's got three buttons and an input text box. One of the buttons goes with the text box, but I want the enter key to do the same thing (gotoAndStop) as the button. Unfortunately I've not a clue how.
View 2 RepliesMy keyboard shortcuts have quit working. I'm not talking custom shortcuts that I have defined. The default Flash shortcuts just don't work anymore.Before anyone asks, yes, I have made sure the "Disable keyboard shortcuts" option is turned off. I'm running Flash CS4 on a Windows XP pro machine.
View 2 Replieshow to change the focus of movieclips and buttons when I press the arrow keys of the keyboard. Its kind like the tab navigation but with de arrows keys, in the four direcctions. This flash app i'm developing has to be handled 100% with the keyboard.
View 2 Repliesadd some functionality to the presentation template. Currently you can only move from one page to the next. So if I want an animation on a page, no problem I'll just add a stop script at the end. No big deal. But if I want Multiple animations (just trying to replace powerpoint here) then I get into trouble.
Each page is one frame on the main timeline. Hitting left/right goes to the next frame, unless the movieclip on that frame also has additional frames. Then it should move to the next frame within that, etc.
I can't figure out that if statement though. I had another bit of script going on my first go, but ran into some issues so thought it best to create all of the scripting on the main timeline. Initially I created a boolean variable, then ran an if statement. Inside of a movieclip I switched the boolean and used the same keyboard interaction to walk through it. On the last frame of that movieclip, I switched the boolean back so the main timeline interaction kicked in again. The problem is, that's a Lot of copying and pasting of that code, and I can't figure out how to go through more than one parent. I just couldn't get it to work.
Should I just be building this thing in a Completely different way? I need to make something, so for now I'm splitting up each frame that I need different animations on and creating a different movieclip for each section. Ideally that would be contained in one movieclip's timeline. Currently one each animation's interaction will be on a timeline. So I have to duplicate the slide to add an animation. So if I have a title come in, then a pie chart, then an image, then another piece of text, I'll be stuck with 4 separate movie clips.
I want something like:if current movie clip current frame is == total frames, clicking right goes to next frame, else go to next frame of it's parent's timeline.I say the parent and not stage because the way you have to set up transitions only works within a movieclip. So you have to set up the entire slideshow within a movieclip if you want transitions between each slide. Right?
I don't care about transitions for now, but will want control of those eventually.
is the following scripts correct to stop animation by pressing "Space Bar" if the animation is playing. And to play the animation again if the animation is paused. Is there any additional criteria need to be added to make it more solid.
keyListener = new Object();var isStopped : Boolean = false;keyListener.onKeyDown = [code]....
I want a keyboard letter in this code:
if(Key.isDown(Key.RIGHT))
{
this._x += 15
}
As you see now there is the right key that is attached to the code but I'm making a 2 player game and I want one of the players to use the letters WASD. Just putting the letter D in there dosen't work.
This boils down to being able to listen to key presses when the application doesn't have the focus. I've tried adding listeners to both stage and NativeApplication, but when the app is minimized it doesn't seem to listen to key events.
Just for the record, I'm trying to implement an app that behaves in the way Spotlight does. It runs on the background and it appears to the user after a keyboard shortcut combination.
If this is not possible, I think I would have to use some sort of helper app to listen to the keys and pass them on to the AIR app via NativeProcess, but it seems a little bit too complicated.
I'm planning to get this working on AIR 2 beta in at least Win and Mac.
I'd like to tell if a certain key is being held down around the startup of my AIR (desktop) application, and I'd like to tell if a specific key (ALT in this case) is being held down. Unfortunately, flex seems to be so event based that there is no way poll the keyboard directly. Can anyone verify this?
I know that it's possible to take the keyboard events and keep track manually. However, this won't work if the user presses the key right before startup, so it isn't a solution for my specific problem.
I have migrated my app from Flex 4.5.1 to Flex 4.6 and the TextInput click event was broken so I do this « skinClass="spark.skins.mobile.TextInputSkin" » (like was suggest here [URL]..and all seems work (tested in my Android and seems ok) but one user with iOS 5.1 complained that now the keyboard dont popup ?
Also complained for the TextArea that I dont have code in my extended component but also use the skin spark.skins.mobile.TextAreaSkin so the layout became similiar in my textinputs.
just a quick question - most tablets and devices have a touchscreen keyboard that will allow the user to enter text. we've all seen them a million times.
How do I
a) set the keyboard to a different type (say numeric) b) how do I change the "done" message to something else say in iOS when it's the ENTER key (i've noticed many apps that do that) c) how do I capture the "ondone" event or "onsubmit" event in Flash builder 4.5.1
I'm trying to write a simple counter. UP or Space increments a number and DOWN decrements. It's just one big number in the middle of the screen. A bell rings on an increment and I have added code to go full screen on mouse click.
Test mode works fine ( except for full screen of course).
Seems to work fine on the local machine using Safari 3.2.3
However if I try to run it locally using firefox it does not work.I need it to run on a laptop but it does not always acknowledge the keyboard events and while in full screen it never responds to the keyboard events.Laptop is running Safari 3.2.1
import flash.display.StageDisplayState;
import flash.events.KeyboardEvent;
var chickCount = 0;[code]..........
I'm building a website where the user can navigate it by keyboard. I'm having difficulties getting the srollbar to work by keyboard, I have it built but I need to work it in if you press shift+right arrow key, it will go to the right, and if you press shift+left arrow key it will go to the left.
As of right now I've tried many different ways of doing this but have only created a mess of my actionscript. When I did get it going to the left or right, the scroller would automatically go all the way to right or left without stopping.
I've enclosed my sample file. and here is my actionscript minus my attempts of working the keyboard actions in:
ActionScript Code:
fscommand("allowscale", "false");
gbar.useHandCursor = gdragger.useHandCursor=false;
space = 20;
[Code]....
I want a keyboard letter in this code:[code]As you see now there is the right key that is attached to the code but I'm making a 2 player game and I want one of the players to use the letters WASD.Just putting the letter D in there dosen't work.
View 1 RepliesI am going though a tutorial were I need to us an or operator its showing it as two vertical lines? How do I input that? I can't find anything like it on my keyboard and in the book it just mentions that the two lines represent the or operator and not how to even put in in the code?
View 3 Replies