9 Replies Latest reply on Dec 15, 2010 10:34 AM by gkaiseril

    Why does this script behavior change with the phase of the moon ?

    RainbowChunChunChang Level 1

      Can anyone from adobe corp or non-adobe volunteers tell me where to look in their docs to find out why this script change its behavior or how to use the debugger to figure out the same. I read the guide and the whole section on debugger and break points etc well.

       

      try{
      this.getField('Button4').strokeColor = color.red   ;
      app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 500 );
      app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 1000 );

       

      app.setTimeOut( "this.getField('Button4').strokeColor = color.red   ;" , 1500 );
      app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 2000 );
      app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 2500 );

       

      app.setTimeOut( "this.getField('Button4').strokeColor = color.red   ;" , 3000 );
      app.setTimeOut( "this.getField('Button4').strokeColor = color.green ;" , 3500 );
      app.setTimeOut( "this.getField('Button4').strokeColor = color.blue  ;" , 4000 );
      }
      catch(e){}

       

      Sometimes the above script cycle thru all the colors in proper order and other time it get stuck.

       

      I have linked it to a button so its part of the button javascript.

       

      Is there a way to craft setTimeOut calls that it becomes a reliable delay ?

       

      How to craft it such that the file does not change and does not have to be saved ? This is wanted in addition but not the essential issue at the moment.

       

      Thanks,

      Rainbow