4 Replies Latest reply on May 19, 2006 12:32 PM by James Newton, ACP

    Paint Behavior

    Rich_Slack
      I was trying to create a simple cavas to draw on using the paintbox behaviors. These were my steps:
      1. New movie
      2. ctrl5 to open paint so the image would be .bmp
      3. draw a rectangle using rectangle tool
      4. Drag rectangle to stage
      5. Drage canvas behavior from library on top of rectangle
      6. Hit play
      7. Click inside of rectangle to draw and I immediately get the error.

      I did not change the script, I have the newest update of director, and I think I have followed all the instructions. Any idea why I get the following error?

      "Script Error: Object Expected pTimeOutObj = timeOut("canvasTimeOut1").new(pTimeInterval, #tryPaintStroke, me)
      me.paintStroke()"
        • 1. Re: Paint Behavior
          Level 7
          > Any idea why I get the following error?
          >
          > "Script Error: Object Expected pTimeOutObj =
          > timeOut("canvasTimeOut1").new(pTimeInterval, #tryPaintStroke, me)
          > me.paintStroke()"

          Yes, because you're using MX2004 and the timeout object creation syntax
          changed. Alter your code to (watch for unintentional line wrapping):
          pTimeoutObj = timeout().new("canvasTimeout1", pTimeInterval,
          #tryPaintStroke, me)
          • 2. Re: Paint Behavior
            Rich_Slack Level 1
            Thank you that did the trick? Do you know if there are a number of behavior scripts that have these same type of errors? Does adobe plan to update these scripts? I appreciate your help!
            • 3. Re: Paint Behavior
              Level 7
              > Do you know if there are a number of behavior scripts that have these same type of errors? Does adobe plan to update these scripts?

              Without wading through all the behaviors that ship with the product, I
              can't answer the first question. To the second, I'd think not. There was
              considerable engineering effort around the new syntax and transitioning
              users, with things like 'the scriptExecutionStyle' and even a MIAW
              script searching tool posted on Devnet - you may want to grab yourself a
              copy
              • 4. Re: Paint Behavior
                James Newton, ACP Level 3
                I wrote the original Paintbox behaviors, but I was not responsible for the modifications made to them in Director 8.5 and later. Changes were required when Director was ported to Mac OS X, as the spinning CD cursor appears on that platform when using the original behaviors.

                You can find my updates to these behaviors, complete with a tutorial on how to create a Paint application with multiple undos at http://director-online.com/buildArticle.php?id=1131