1 Reply Latest reply on Aug 9, 2007 6:15 PM by RobinsEgg

    Code in AS3 Manual not compiling

    RobinsEgg
      The following AS 3.0 code snippet from the manual (page 135):

      //************************************

      //Compiles only in standard mode
      someFunction.counter = 0;

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

      someFunction();
      someFunction();
      trace(someFunction.counter); // 2

      //************************************

      generates the following error when testing the movie:

      ReferenceError: Error #1056: Cannot create property counter on builtin.as$0.MethodClosure.
      at Untitled_fla::MainTimeline/Untitled_fla::frame1()

      I've tried using both Standard and Strict compiler modes.

      Can anyone shed some light on the issue?