1 Reply Latest reply on Aug 29, 2006 5:26 AM by Peter Lorent

    reading keyboard in oop AS2

    asden Level 1
      Just getting to use AS2 OOP and while I understand nearly all the game should be in classes rather than the fla timeline, all the game code I've seen, even those games that define the game objects in classes, still put the keyboard reading commands in the fla. Is this good practice?

      I've tried putting the key commands in classes and can't get them to work. Can someone post a short example of reading a keyDown in a class. Thanks
        • 1. Re: reading keyboard in oop AS2
          Peter Lorent Level 2
          >> Is this good practice?
          Well, technically speaking in true OOP, probably not.

          >> Can someone post a short example of reading a keyDown in a class.
          See attached. The class moves a mc (in the fla there should be a mc with a linkage name 'Ball') untill you hit the spacebar.