2 Replies Latest reply on Nov 7, 2006 3:05 AM by Newsgroup_User

    Flash player bug?

    Zimmen
      Try this code:
      var t:Number = 0;
      ID = setInterval (function (){t += .1;trace (t);}, 1);

      and look at the output window to see the weird results!
        • 1. Re: Flash player bug?
          Marghoob Suleman Level 1
          yes it seems... :-)
          • 2. Re: Flash player bug?
            Level 7
            No .. its a bug in your understanding of local variables and scope combined
            with the stupid way var (doesn't) create local variables unless its inside a
            function (in your case it isn't)

            The problem here is that in the nameless function being called by the
            interval, there is no way for it to find the variable 't' which lives inside
            the timeline of the scene/clip where you put this script. Instead, it
            thinks you must be using some local variable called 't', which is undefined.
            --
            Jeckyl