1 Reply Latest reply on May 19, 2011 1:33 AM by Peter Blazejewicz

    strange way to instance varables

    Benoitcn Level 1
      aArray = new ArrayCollection;
      aArray = new ArrayCollection();
      Do these the two ways of instance varables have the same result ?
        • 1. Re: strange way to instance varables
          Peter Blazejewicz Level 4

          Hi,

          this seems to be shortcut (compiler feature) but only for constructors for classes that:

          - have no arguments at all

          - have defaults values for argument in constructor, e.g.:

          public function MyClass(name:String=null)

          - or have rest arguments in constructor

          public function MyClass(... rest)

          I've been seeing that usage before in others code but I don't remember if there is anything official on that usage in AS3 reference docs,

           

          regards,

          Peter