Key Press to named Scene/Frame wont work

Hi
First time using Flash in years. I'm using AS2 and Flash CS6.
I have a 4 scene movie and my client wants to right-cursor through the scenes. So it's just like a Powerpoint presentation really.
On each Scene, I have a Button MovieClip whcih tells the movie to advance a Scene.
This works on every Scene bar the first Scene and I just can't understand why.
Here's the AS2 on Scene 1s button. Vs is my next Scene and then the START-VersusScene is my frame label.
on (keyPress "<Right>") {
          gotoAndPlay("Vs", "START-VersusScene");
Oddly enough this works perfectly when I just preview the movie but as soon as I publish to HTML it won't work.
Another oddity is that if I click (mouse) the button and *then* hit my Right Cursor, it works.
I just don't understand whats wrong with the damn thing.
I know a lot of ppl would say I should be using perhaps AS3 or not scenes or even not "on" events but this is a quick turnaround project and my time to learn all of the above didn't exist.
Many thanks

1.  don't attach code to objects (like buttons).  attach code to your main timeline.
2.  don't use the goto functions.  use the goto methods.
3.  don't use scenes for navigation.  use frame labels.
for example,
var lo:Object = new Object();
lo.onKeyDown = keydownF;
Key.addListener(lo);
var tl:MovieClip = this;
function keydownF() {
    if (Key.isDown(Key.RIGHT)) {
        tl.gotoAndStop('whatever');
    } else if(Key.isDown(Key.LEFT)){
        tl.gotoAndStop('whatever_else');

Similar Messages

  • Why my numeric key pad on my wired keyboard wont work with snow leopard?

    Why my numeric key pad on my wired apple keyboard wont work with snow leopard?
    Thanks - Farshad

    What do you know, I figured out.
    Go to System Preference > Universal Acces> Mouse > check the "Press the option key five times to turn mouse keys on or off.
    Thanks

  • Ipad will not slide to unlock. have tried home key and power button and still wont work

    Ipad will not slide to unlock. Have tried home key and power button but has not worked. Help please?

    Did you input you correct passcode? The iPad may be disabled.
    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    You may have to do this several times.
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just canceling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • Scene Detect wont work in Prermiere CS3

    I captured one tape using premire pro cs3 and when I tryed capturing my second tape scene detect would not work. I am able to click it but it does not scene detect. Whats wrong?

    Hey Markar1949,
    I wonder what camera your using.  I assume you got scene detection with the first tape and not the second?  If so this may indicate that your using a 'supported' camera, however expect scene detection to go 'bad' if you've introduced timecode errors to the tape while you were capturing.  If you have timecode errors who will have to do a work around.  Chech 'Timecode errors' in the Adobe help references.

  • Key pressed event

    I need message to be displayed when certain key pressed. Why it's not working?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class TestKey extends JPanel implements KeyListener {
         public TestKey(){
              addKeyListener(this);
         public static void main(String arg[]){
               JFrame frame = new JFrame();
                  frame.setTitle("Test my keybord, man!");
                  frame.setSize(300, 200);
                  frame.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                      System.exit(0);
                  Container contentPane = frame.getContentPane();
                  contentPane.add(new TestKey());
                  frame.setVisible(true);
         public void keyPressed(KeyEvent ke){
              System.out.println("key pressed");
         public void keyTyped(KeyEvent ke){
              System.out.println("key typed");
         public void keyReleased(KeyEvent ke){
              System.out.println("key released");
    }

      public TestKey(){
        setFocusable(true);//<----------
        addKeyListener(this);
      }

  • How to listen to key press in JTable

    I've been trying to listen to key press in JTable,
    However it only works if the cell is double-clicked.
    If the tab button is use or the cell is single-clicked, nothing happens to the listener.
    Anybody can help me???
    Thanks

    table.getColumnModel().addColumnModelListener(new TableColumnModelListener(){
      public void columnAdded(TableColumnModelEvent e){}
      public void columnMarginChanged(ChangeEvent e){}
      public void columnMoved(TableColumnModelEvent e){}
      public void columnRemoved(TableColumnModelEvent e){}
      public void columnSelectionChanged(ListSelectionEvent e){
        // column selection changed
    table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent event) {
        // row selection changed
    });rykk

  • 3.2.3;Capture Escape key on all along a Frame?

    A frame has several components like buttons, textfield, Combo,GridControl and so on. For some reason which i don't know why, The rows on gridControl disappears and replaces with blank rows, if Escape key pressed immediately after this Frame loaded.
    And an error message raises says some of the conditions on rowSet which is bound to grid are null.
    I debugged this frame and couldn't find the bug. Now needed some how to trap the Escape key and disable it. Please advice.
    null

    repost

  • Detecting a Key Press

    I am using this code to set up a listener for a key press. I
    noticed that it works fine when you use a LEFT, RIGHT etc. press,
    but it will not work with a regular key press(i.e. ctrl+P). It says
    that there is an undefined property as far as the Letter goes. If
    anyone can help me with this, I would very much appreciate it.
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);
    function keyDown(event:KeyboardEvent):void
    if(event.ctrlKey)
    var key = event.keyCode;
    var P_key = Keyboard.P;
    switch(key)
    case P_key:
    trace("this thing works");
    break;
    }

    Ok, I've figured it out. Flash decided to take me for a fool
    and pretended like it would take the P-key as a press, but in
    actuality, it only works that way in AIR.

  • 'O' Key Wont Work Sometimes

    Yesterday my 'O' key randomly started to go weird; all of my other buttons work perfectly but when I press the 'O' button, sometimes it wont work. I have absolutely no idea what has caused this but any help would be amazing! The phone is 8 days old and uninsured so I need a fix as I can't send it back!
    Thanks in advance!

    Since it seems to be a hardware problem, so would request you to visit nearest Blackberry Authorised Service Station who can look into the matter and can suggest.
    Because your problem doesnt seems to be a software issue which can be resolved online.
    Hope that resolves your issue!

  • Help with  On key press and Frame

    Hi everybody,
    I have been trying to make this work but not able to. It would be of great help if u can tell where i am going wrong. Here is my code ( it is prety small) :
    I am trying to draw a random line when i do a keypress on the text field.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    public class KeyPress extends Frame{
    Label label;
    TextField txtField;
    public static void main(String[] args) {
    KeyPress k = new KeyPress();
    public KeyPress(){
    super("Key Press Event Frame");
    Panel panel = new Panel();
    label = new Label();
    txtField = new TextField(20);
    txtField.addKeyListener(new MyKeyListener());
    add(label, BorderLayout.NORTH);
    panel.add(txtField, BorderLayout.CENTER);
    add(panel, BorderLayout.CENTER);
    addWindowListener(new WindowAdapter(){
    public void windowClosing(WindowEvent we){
    System.exit(0);
    setSize(400,400);
    setVisible(true);
    public class MyKeyListener extends KeyAdapter{
    public void keyPressed(KeyEvent ke){
    char i = ke.getKeyChar();
    String str = Character.toString(i);
    label.setText(str);
    Line2D myLine = new Line2D.Double(5,5,100,100);
    }

    Here's what I come up when I played with your code.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.Random;
    public class KeyPress extends Frame {
        TextField txtField;
        Panel panel;
        public static void main(String[] args) {
            KeyPress k = new KeyPress();
        public KeyPress(){
            super("Key Press Event Frame");
            panel = new myCanvass();
            txtField = new TextField(20);
            txtField.addKeyListener(new MyKeyListener());
            panel.setBackground(Color.LIGHT_GRAY);
            add(txtField, BorderLayout.PAGE_END);
            add(panel, BorderLayout.CENTER);
            addWindowListener(new WindowAdapter(){
                public void windowClosing(WindowEvent we){
                    System.exit(0);
            setSize(400,400);
            setVisible(true);
        class myCanvass extends Panel {
            private Graphics2D g2;
            public void paint(Graphics g) {
                drawLine(g);
            private void drawLine(Graphics g) {
                g2 = (Graphics2D) g;
                g2.setColor(Color.RED);
                g2.draw(new Line2D.Double(Math.random() * 150, Math.random() * 150, Math.random() * 200, Math.random() * 200));
        class MyKeyListener extends KeyAdapter{
            public void keyPressed(KeyEvent ke){
                char i = ke.getKeyChar();
                String str = Character.toString(i);
                panel.repaint();
    }

  • A key wont work on my keyboard

    The 1 and 2 keys wont work on my keyboard..Any ideas? Computer is about a  year old.

    Hi, under the flag icon at top right of the screen, open Keyboard Viewer, does that show the keys not pressed?

  • Key pad and trake pad wont work

    I have a curve9360 and for some reason the other day it just decided it wont work.  The phone is password protected and it wont let me type anything password or not. This morning i finally got into the phone but the trackpad wouldnt don anything except stay on the time and date at the top of the screen.  I havent had the phone long im totally lost can anyone help me please??

    Hi and Welcome to the Community!
    For your first diagnostic step, I recommend that you attempt to boot into Safe Mode:
    KB17877 How to start a BlackBerry smartphone in Safe Mode
    It may take you multiple attempts to get the ESC key sequence (press/release/hold) correct, so be patient. When successfully into Safe Mode and if the behavior does not present, think carefully...what happened just before this behavior started? A new app? An update? A Theme? Something else? Think carefully as the smallest change could be causal...and attempt to undo whatever that was.
    If the behavior presents in Safe Mode, then there are much more challenging diagnostic/repair steps to attempt, none of which are guaranteed to work, especially if you have a hardware problem...which, if that is the case, would need diagnosis/evaluation by a qualified hardware technician (preferably under warranty, if you have such).
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • First key pressed doesn't work?

    Strange, but lately, I would say about 85% of the time, the first key I hit on my keyboard doesn't work. It doesn't matter what key, letter or number, it doesn't work. I'll look up at what I've typed and the first letter is always missing. It's turning into a huge nuisance and I don't think it's me not pressing hard enough or something silly like that, because it happens so very often and I certainly am not changing the way I type for the last 30 years or so.
    Any ideas what could be causing it? It's as if it takes a second for the keyboard to realize it's being used and by then, I've typed on by.
    I'm using the standard Apple keyboard that came with the G5, but it's not the original. This one I've had for about a year and a half.
    tia.

    I had your issue on two Macs for over a year. A combination of the following cleared it up for me;
    Try using Disk Utility to do a Disk Repair, as shown in this link, while booted up on your install disk.
    You could have some directory corruption. Let us know what errors Disk Utility reports and if DU was able to repair them.
    Then I Repaired Permissions in DU using the version on your hard drive.
    Then I downloaded the
    Combo Update, yours would be the 10.5.4 Combo
    You can apply it right over the one you have now with no trouble--use the link, not Software Updates version.
    Repaired Permissions and made sure all the other updates for my Mac's were up to date.
    Then I went further with it, and used a utility you may not have.
    I used and would recommend DiskWarrior.
    After all these actions the issue I had (yours) disappeared. Some here have said one of the recent updates dealt with this agravating condition, and if so, thank you Apple!
    I feel my tips are what fixed it for me. I was a big contributor to two enormous threads on this problem, and have read every post on the subject.
    Hope this helps.
    DALE

  • Closing windows in Expose using key press (or why does apple-W not work?)

    I often end up with lots of Safari windows open & need to prune them down. (Yes I use tabbed browsing too .
    So I thought I'd use Expose, see the windows I needed to close, select the one I wanted to close and hit apple-W which works fine to close a window when not in Expose. However for me it doesn't work in expose (though its fine when not in expose).
    This leads to a rather slow process of going into expose, selecting the window you want to close, coming out of expose, then hitting apple-W to close that window, then going back to expose.
    I'd much rather just go into expose, hover over the window I want to close (or use cursor keys to pick the right one) and hit apple-W; then I can close a few windows without having to leave expose.
    Has anyone ever figured out a way to get apple-W - or any key press at all - to close the currently selected window in expose?
    BTW I know you can quit an application in Expose; which is great. However in this case I want to close just a selected window in expose (e.g. a particular safari window), not the whole application.

    You have a great idea. But it isn't supported. Yet.
    Send your idea to Apple (they read all submissions) http://www.apple.com/macosx/feedback

  • Capturing Key press when the focus is not on VI. (event is not working).

    I have a VI, and found similar in Forums. I need to catch key down event, when the focus is not on VI.
    I attached the VI found in forum. Try to click on other window, for example on block diagram of VI, when VI is running and check if it works. The answer is no, it doesn't work. When you press any key, the led button must change it's state, but it does only when the focus is on VI's front panel. The question is how to control key press, when VI is minimized or inactive. Is it possible to catch key down or any similar event, when the focus is on any other application, not on VI?
    Solved!
    Go to Solution.
    Attachments:
    simulatekeyevent.vi ‏16 KB

    Have a look at the "Connectivity...input devices..." menu.
    For an example, open the example finder and look for "basic input demo". It should give you some ideas. Good luck!
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for