2 Replies Latest reply on Sep 29, 2006 3:36 AM by Starlover_jacob

    simple counter

    Starlover_jacob Level 1
      hello,

      can someone help me with a simple thing here.
      in php you can do something like this
      counter=counter++;

      how do i do this in flex?
      i tried the following but i get a load of errors.
      ---------------------------------------------------
      var counter:Number=counter+1;
      warning: 3596 duplicate variable definition.

      --------------------------------------------------
      someFunction.counter = 0;

      function someFunction () {
      someFunction.counter++;
      }

      someFunction();
      someFunction();
      trace (someFunction.counter); // output: 2
      errors:
      1119: acces of possibly undefined property counter through a reference with static type function. (3 times)