5 Replies Latest reply on Jun 11, 2011 7:59 AM by kglad

    Help! with HitTests

    LukeElChul Level 1

      i put this in the first frame but it dosent work

       

      i whant it so if unit toched tower_gun for 5 secounds tower_gun should go to the next frame and after another 5 secounds to the next frame and so on but i just get errors i dont know if ive wrote the script wrong are what.

       

       

      if(_root.unit.hitTest(_root.tower_gun)
      var myInterval= set Interval(myfunction,5000);
      _root.tower_gun.nextFrame()
      function myfunction():Void{
      clearInterval(myInterval);
      }
      }

       

       

      errors are........

       

      **Error** Scene=Scene 1, layer=Towers, frame=1:Line 43: ')' expected
      var myInterval= set Interval(myfunction,5000);

      **Error** Scene=Scene 1, layer=Towers, frame=1:Line 48: Unexpected '}' encountered
      }

      Total ActionScript Errors: 2   Reported Errors: 2