4 Replies Latest reply on Feb 22, 2007 12:03 PM by Rothrock

    Weird Drawing Issues

    SymTsb Level 2
      Hey guys.

      REMOVED LINK

      After the images load, you'll notice that the right side bottom and bottom line segments for the border appear to be drawing slightly off key from where they should be. It's straightforward AS but I've provided that as well.

      This function for the border isn't called until onLoadInit fires from my MovieClipLoader (it's actually part of the onLoadInit). At first, I thought it was because the function fires while the image is loading but that's impossible as far as I know since it will not fire until AS for the target is loaded but even so, that would result in a much larger box around the image as well since the thumbs are generated from the full size image.

      Any ideas as to why my movie is having issues??
        • 1. Re: Weird Drawing Issues
          Level 7
          The dimensions are changing as you draw. Get your width and height before
          you draw:

          private function pcDrawThumbBorder(target:MovieClip):Void {
          var _w = target._width;
          var _h = target._height;
          target.createEmptyMovieClip("border_mc", target.getNextHighestDepth());
          target.border_mc.moveTo(0,0);
          target.border_mc.lineStyle(5, borderColor);
          target.border_mc.lineTo(_w, 0);
          target.border_mc.lineTo(_w, _h);
          target.border_mc.lineTo(0, _h);
          target.border_mc.lineTo(0,0);

          }


          • 2. Weird Drawing Issues
            Is something rotated on the stage?
            • 3. Re: Weird Drawing Issues
              SymTsb Level 2
              Thank you. That was indeed the issue. I'm not sure I understand how or why the dimensions would change as I'm drawing seeing as the image is already loaded into the movie but storing the dimensions at the start of the function fixed the problem. I appreciate the help.
              • 4. Re: Weird Drawing Issues
                Rothrock Level 5
                Because the line you are drawing takes up some space. So the error should have been half the thickness of the top line.