0 Replies Latest reply on Feb 15, 2010 7:28 AM by Roland684-oqZIvV

    [flash lite 2.1] problem drawing rectangles

    Roland684-oqZIvV

      I want to draw some rectangles and lines on a movieclip using actionscript (2). sounds simple enough. Just stuff like:

      mc.lineStyle(0,0xFFFFFF, 0);
      mc.beginFill(0xFFFFFF,48);
      mc.moveTo(8,4);
      mc.lineTo(40,4);
      mc.lineTo(40,80);
      mc.lineTo(8,80);
      mc.endFill();   

      mc.lineStyle(1,0xFFFFFF, 78);
      mc.moveTo(10,100);
      mc.lineTo(110,100);

      etc.


      But when I draw multiple rectangles and lines, at some point they seem to start to mess each other up. Wierd shapes appear at slightly related locations when drawing rectangles. (Not when drawing lines)
      When I draw a 3rd rectangle, instead of that rectangle I get some weird shape, which seems xorred with part of the desired rectangle.
      For example: from the right side of one rectangle (x1) and the bottom of a line (y1) to the left right side of the screen (x2) and the top of another line (y2) a triangle with a gap in the middle is drawn with the background color of an other rectangle (it is a semi-transparent box, so you see a background color).
      Don't try to picture this shape, just know that it is far more complex than what' I'm drawing, but seems to touch coordinates used in previous shapes.

      It doesn't make sence, it's as if some drawing is done with left over garbage of precious shapes thrown into a big mixer. Throw all properties of all fills and lines in one big hat, pull 10 of them out of the hat an draw something with it.
      The undesired drawing itself is random/unpredictable, but it is the same each run. (changing the order in which slapes/lines are drawn sometimes changes the shape. first drawing the filles and than drawing the lines, seems to prevent the issue, but it can not always be done without complication the code a lot)


      This happens on my flash-lite enabled device, but the emulator in adobe's device central also displays these weird shapes, although slightly different (a bit narrower, or a different color or some other slight variation)
      When published for flash 7 or 8 and run with the desktop flash (10) the drawing is done correctly.

      Drawing each rectangle in it's own movieclip prevents this problem, but creates extra movieclips, complicating thing with layers and such.

      This make me think you shouldn't draw multiple shapes on a movieclip in flash lite??? (because of some weird bug?)

      Is this a known issue with flash lite?
      or is this just not the way to draw shapes in flash lite?