It looks to me like a player bug with opaqueBackground.

 

Try drawing like this instead:

 

            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

            {

                        super.updateDisplayList(unscaledWidth, unscaledHeight);

                       

                        graphics.clear();

                        graphics.lineStyle(1, 0x00ff00);

                        graphics.beginFill(0xff0000);

                        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);

                        graphics.endFill();

            }

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of Steven Toth
Sent: Tuesday, August 22, 2006 12:33 PM
To: [email protected]
Subject: [flexcoders] Issue with drawing on UIComponent

 

I'm subclassing UIComponent and want to draw a lines around certain
edges (a pseudoborder), however when I use the graphics object to
draw the lines from the upper left corner (0, 0) to the lower left
corner (0, unscaledHeight) in updateDisplayList() the line shows up a
pixel 1 (i.e. I see the UIComponent background on the outside [left]
of the line). Event hough it should be relevant since I'm drawing
and not adding child controls I've tried setting all the styles I
could think of that might be impacting where the line appears (such
as paddingLeft, leading, borderStyle, borderThickness, etc).
However, the line still shows up with the UIComponent background on
the outside of it. This also occurs on the top of the control, but
not of the right or bottom. Here's is sample code to reproduce the
issue. Anybody have any ideas?

package samples
{
import mx.core.UIComponent;

public class UIComponentControl extends UIComponent {
public function UIComponentControl() {
super();
opaqueBackground = 0xff00000;
}

protected override function updateDisplayList
(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth,
unscaledHeight);

graphics.clear();
graphics.lineStyle(1, 0x00ff00);
graphics.moveTo(0, 0);
graphics.lineTo(0, unscaledHeight);
graphics.lineTo(unscaledWidth,
unscaledHeight);
graphics.lineTo(unscaledWidth, 0);
graphics.lineTo(0, 0);
}
}
}

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to