3 Replies Latest reply on Sep 2, 2007 2:47 PM by kglad

    Help - Flash 8 graphics bug w/ transparency and Drawing API


      I was wondering if anybody has a workaround for this bug?

      When I use the Drawing API to create a filled circle in a new MovieClip (using the drawCircle function defined in the docs), and then set the new clip to 50% alpha, half of the stroke is set to 100% alpha. It's easy to reproduce, just stick the following in a new flash doc and you'll see what I mean:

      createEmptyMovieClip("a", 10);
      this.a._x = 50;
      this.a._y = 50;
      this.a._visible = true;
      this.a._alpha = 50;
      this.a.lineStyle(10, 0xFF0000, 100);
      this.a.beginFill(0x888888, 100);
      drawCircle(a, 50, 50, 50);

      function drawCircle(mc:MovieClip, x:Number, y:Number, r:Number):Void
      // Taken directly from the Flash documentation
      mc.moveTo(x+r, y);
      mc.curveTo(r+x, Math.tan(Math.PI/8)*r+y, Math.sin(Math.PI/4)*r+x,
      mc.curveTo(Math.tan(Math.PI/8)*r+x, r+y, x, r+y);
      mc.curveTo(-Math.tan(Math.PI/8)*r+x, r+y, -Math.sin(Math.PI/4)*r+x,
      mc.curveTo(-r+x, Math.tan(Math.PI/8)*r+y, -r+x, y);
      mc.curveTo(-r+x, -Math.tan(Math.PI/8)*r+y, -Math.sin(Math.PI/4)*r+x,
      mc.curveTo(-Math.tan(Math.PI/8)*r+x, -r+y, x, -r+y);
      mc.curveTo(Math.tan(Math.PI/8)*r+x, -r+y, Math.sin(Math.PI/4)*r+x,
      mc.curveTo(r+x, -Math.tan(Math.PI/8)*r+y, r+x, y);

      You can see it looks like there are two strokes instead of one. This is a very serious bug in my graphics and I don't know how to get around it! Does anybody have any advice?

      I'm using Flash 8.

      Much thanks