I have very little access to the graph class of Flex. This time I just tried to draw a border for a pair of images.
But record it. After all, it is the first time to use the flex plotting class.
At that time, we wanted to draw a stroke for an image,CodeThe test results are as follows:
Private function imageclickhandle (EVT: mouseevent): void
{
Rectangle = new uicomponent (); // defines a rectangle.
Imagecanvas. addchild (rectangle); // Add this rectangle to the parent container where the image is to be drawn.
Imagecanvas. setchildindex (imagecanvas. getchildat (imagecanvas. numChildren-1), 0); // place the rectangle to the bottom of the border, so that the middle part is covered by the graph.
Rectangle. Graphics. beginfill (0xbbdb00, 0.3); // set the color and Alpha value (transparency)
Rectangle. graphics. drawrect (EVT. currenttarget. x, EVT. currenttarget. y, (EVT. currenttarget. width), (EVT. currenttarget. height); // call the graphics class to draw
Rectangle. Graphics. endfill (); // The painting is complete.
}
Finally, a summary http://www.cssflex.com/huatu.asp for the drawing class is recommended.