1 Reply Latest reply on Oct 23, 2013 9:53 AM by ed@edkelley.biz

    Problem with try taking long time to execute

    ed@edkelley.biz Level 1

      I have a function which check to see if there is a selection:

       

       

      public static function testForSelection():void 

      {

                try

                {

                          var dSel:Array = app.activeDocument.selection.bounds;

                          model.fromMarquee = true;

         }

                catch (e:Error)

                {

                          model.fromMarquee = false;

                }

                trace("model.fromMarquee " + model.fromMarquee);

      }

       

       

      The first time the function runs with no selection it can take minutes to run. Any time after with no selection it run almost immediately.

       

      I know the array is null but why would it take so long for the error to resolve?