4 Replies Latest reply on Jul 8, 2009 2:09 PM by neesboy

    Neophyte needs help handling cross-class variable changes.

    neesboy

      I recently decided to learn Actionscript. I'm taking the plunge, and jumping straight into making a fighter game with a little aid from some tutorials on a few parts of it. It's going fine, though I'm sure my form is none to great. The issue I've run into is I'm not sure how to make one class change a variable in another. The specific case is that I've got a p1 and a p2 class, and I want to be able to increase their delay when they get hit. I'd also like being able to do stun attacks, and set up a dynamically scrolling background to give the illusion of a wider playing field. I've got all the logic worked out, I just need to know how I tell the p1 class to alter a variable in p2, and vice versa. Thanks!

       

      Oh, by the way: I'm using AS2 because the tutorials were designed for it. If switching to AS3 is necessary, I'll learn what I have to, but I would prefer to stay with 2 if it works.