1 Reply Latest reply on Jan 15, 2009 12:13 PM by kglad

    how to trigger an event once?

    shintashi Level 1
      I want to be able to trigger an event only once with a self terminated collision detection, such as
      if (score >= 50){ money = +1};

      but I keep getting stuck in the loop of "money = +1,2,3..." because it's loaded inside an on enter Frame.

      I also run into this problem with if (x = y){money = +1}.

      I sort of got around it by stating if (x = y && hitTest(object)) but when the numbers are variable (such as points) the money bonus ends up being variable as well.

      For example, if I have 50 score points etc., then if I have an if = 50; scores in multiple of three would go straight from 48 to 51, skipping the 50,

      and if I have a if >= 50; multiples of 1,2, and 5 would land on 50 precisely, but values such as 3,4,6,7 and so forth would show up at 51, 52, and 54. This has the peculiar effect of changing the number of times it scores the bonus.