1 Reply Latest reply on Nov 23, 2006 7:56 PM by James Newton, ACP

    Hazard Perception Test

    Jake_Pomme
      How easy would it be to create a hazard perception test i.e. take a photo and divide it into sections and when the user clicks on a section with a hazard, they increment their score. Obviously there would need to be some sort of check to see if the hazard has already been selected or the user would get too many points for the same hazard. It would also need to check when all the hazards have been identified. Has anyone created anything like this before and if so do you have any code available.
        • 1. Re: Hazard Perception Test
          James Newton, ACP Level 3
          Create a separate bitmap member for each hazard.
          Drag each hazard member onto the Stage to create a sprite.
          Select all the hazard sprites, then Right-click (Windows) or Control-click (Mac) and select Script... from the contextual menu.
          In the script window that opens, type or paste the following scriptText:

          property spriteNum

          on mouseUp me
          AddHazard(spriteNum)
          end


          Create a movie script. Type or paste the following scriptText:

          global gHazardList


          on startMovie()
          gHazardList = []
          end


          on AddHazard(aSpriteNum)
          if not gHazardList.getPos(aSpriteNum) then
          gHazardList.append(aSpriteNum)
          end if

          vCount = gHazardList.count

          if vCount = 1 then
          alert "You've found 1 hazard."

          else
          alert "You've found "&vCount&" hazards."
          end if
          end


          In the Control menu, make sure that Loop Playback is checked.
          Run your movie.
          Click on the hazard sprites.

          Now think about how you could improve the movie.