3 Replies Latest reply on Jun 11, 2007 7:08 PM by kglad

    AS2: Custom Class Design Ideas

    Rothrock Level 5
      I'm making some interactive math learning games for kindergarten through second grade. One thing I'm trying to incorporate is what I call "wild clicking." A small child might just start randomly clicking around the stage. I want to capture that and if it goes beyond some limit of random clicking I want to give some feedback that they need to "get back on task" as it were.

      So I'm trying to figure out how best to implement this as a class so that it can be quickly and easily deployed. Across a number of games. I can easily count the number of clicks and when it gets past a set number issue an event. So my game would listen for that event and each game could do what was appropriate for it. So far not a problem.

      The tricky part comes in on defining what counts as a random click. Generally something that is just part of the "scenery" – something that doesn't have a reason to click on it – counts. These games include all kind of drag and drop, move around the stage, pile them up and count, kind of things, as well as quit buttons, score charts, etc.

      So I was thinking of having each of type of manipulative item tell the WildCounter to reset to zero, but that requires adding that code to each item. I was also thinking of "registering" each item that didn't count as a random click with the WildCounter and having the WildCounter onlyincrement if the click wasn't on one of the items.

      Or is there some third way? Any suggestions or ideas. Thanks.
        • 1. Re: AS2: Custom Class Design Ideas
          kglad Adobe Community Professional & MVP
          i'd use a mouseDown to check a hitTest loop running through movieclips and objects. if the hitTest is neg for all movieclips and objects, i'd register a wildCounter increment.

          and then scare the heck out 'em. tell them their house is going to fall through the earth and their computer is going to explode.
          • 2. Re: AS2: Custom Class Design Ideas
            Rothrock Level 5
            No wonder the small children don't like math! Isn't your specialty pediatrics? No wonder, you are soooo good with children.

            Thanks I am leaning toward that approach. I will need some way to "register" the movieclips that count as a good hit because there are often many movieclips that are just part of the animated background and shouldn't be clicked on.

            Thanks. Its nice sometimes to listen to the voices outside my head!
            • 3. Re: AS2: Custom Class Design Ideas
              kglad Adobe Community Professional & MVP
              lol, yep. i'm a pediatrician. but i would never say anything like that. it's fun to laugh about it but it could really upset a child younger than 11 years of age that would be inclined to believe such non-sense.