-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDrawLine.as
60 lines (56 loc) · 1.7 KB
/
DrawLine.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.geom.*;
import flash.media.*;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.text.*;
import flash.net.*;
public class DrawLine extends Sprite {
[Embed(source='./images/CarAdd.swf')]
public var add_anime:Class;
public var movie:MovieClip;
public var start_x:Number;
public var start_y:Number;
public var end_x:Number;
public var end_y:Number;
public var main:Main2;
public var line:Sprite
public var line_up:Sprite
public var button:Button1;
public var street:Street;
public var state:String = "off";
public function DrawLine(main_input:Main2){
main = main_input;
line = new Sprite();
line.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownHandler);
line.addEventListener(MouseEvent.MOUSE_UP,mouseUpHandler);
line.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoveHandler);
line.addEventListener(MouseEvent.MOUSE_OVER,mouseOverHandler);
line.addEventListener(MouseEvent.MOUSE_OUT,mouseOutHandler);
}
private function mouseDownHandler(evt:MouseEvent):void{
}
private function mouseUpHandler(evt:MouseEvent):void{
}
private function mouseMoveHandler(evt:MouseEvent):void{
}
private function mouseOverHandler(evt:MouseEvent):void{
}
private function mouseOutHandler(evt:MouseEvent):void{
}
public function Line(x0:Number,y0:Number,x1:Number,y1:Number):Sprite{
start_x = x0;
start_y = y0;
end_x = x1;
end_y = y1;
line.graphics.clear();
line.graphics.lineStyle(20,0xe7e7e7);
line.graphics.moveTo(x0,y0);
line.graphics.lineTo(x1,y1);
return line;
}
}
}