读书人

flex案例四

发布时间: 2012-09-22 21:54:54 作者: rapoo

flex案例4

package com.deng
{
??? import flash.geom.Point;
???
??? import mx.core.UIComponent;
???
??? public class LinkLine extends UIComponent
??? {
??? ???
??? ??? //线起点
??? ??? private var startPoint:Point;
??? ??? //线终点
??? ??? private var endPoint:Point;
??? ??? //线条颜色
??? ??? private var lineColor:uint=0x000000;
??? ???
??? ???
??? ??? public function LinkLine()
??? ??? {
??? ??? ??? super();
??? ??? }
??? ???
??? ??? public function drawLine(): void{
??? ??? ??? this.graphics.clear();
??? ??? ??? this.graphics.lineStyle(2,lineColor);
??? ??? ??? this.graphics.moveTo(startPoint.x,startPoint.y);
??? ??? ??? this.graphics.lineTo(endPoint.x,endPoint.y);
??? ??? ???
??? ??? }
??? ???
??? ??? public function setStartPoint(point:Point):void{
??? ??? ??? this.startPoint=point;
??? ??? }
??? ??? public function setEndPoint(point:Point):void{
??? ??? ??? this.endPoint=point;
??? ??? }
??? ???
??? }
}

读书人网 >flex

热点推荐