2 Replies Latest reply on Jun 19, 2009 10:29 AM by GordonSmith

    How to specify an object as a default value of an optional parameter

    DaveFastFingers Level 1

      All the tutorials and adobe documentation on optional parameters describes how to define an optional function parameter wtih a number or string, but none that I can find describe hwo to do it with an object.

       

      I need something like this to work:

       

      function myFunction( arg1:MyObject = new MyObject(0,0,0) ){...}

       

      This generates a compile error, so I'm doing it wrong. And I can't figure out how to specify an object as a default parameter, nor can I find any reference to whether it's even possible or not.

       

      Thanks!

      David