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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
class BarArrow extends BarStyle
{
public function BarArrow( val:String, name:String )
{
super( val, name );
}
public function draw_bar( val:ExPoint, i:Number )
{
var mc:MovieClip = super.draw_bar( val, i );
//var mc:MovieClip = this.bar_mcs[i];
mc.lineStyle( 2, 0x000000, 100);
mc.moveTo( val.left+(val.bar_width/2), val.bar_bottom );
var steps:Number = Math.floor( 4+Math.random()*4);
var height:Number = (val.bar_bottom-val.y)/steps;
var x:Number;
var y:Number;
for( var i:Number=1; i<steps; i++ )
{
x = Math.random()*(val.bar_width/2);
y = val.bar_bottom-(height*i)
// zig-zag the line:
if( i%2==0 )
x += val.left;
else
x = val.left+val.bar_width-x;
mc.lineTo( x, y );
}
mc.lineTo( val.left+(val.bar_width/2), val.y );
//
//
//
mc.moveTo( val.left+(val.bar_width/2), val.bar_bottom );
var steps:Number = 8;
var height:Number = (val.bar_bottom-val.y)/steps;
var x:Number;
var y:Number;
var prev_x:Number = val.left+(val.bar_width/2);
var prev_y:Number = val.bar_bottom;
for( var i:Number=1; i<steps; i++ )
{
// x = Math.random()*(val.bar_width/2);
y = val.bar_bottom-(height*i)
// zig-zag the line:
if( i%2==0 )
x = val.left;
else
x = val.left+val.bar_width;
mc.curveTo( x, y, val.left+(val.bar_width/2), val.bar_bottom-(height*(i+1)) );
}
mc.lineTo( val.left+(val.bar_width/2), val.y );
x = val.left+(val.bar_width/2)-x;
y = val.y-y;
var angle:Number = Math.atan(y/x)/(Math.PI/180);
if( x<0 )
{
angle += 180;
}
if( x>=0 && y<0 )
{
angle += 360;
}
angle += 180;
var r:Number=20;
var radian = (angle+20) * Math.PI/180;
var cos:Number = Math.cos(radian);
var sin:Number = Math.sin(radian);
var x_1 = Math.cos(radian)*r;
var y_1 = Math.sin(radian)*r;
var radian = (angle-20) * Math.PI/180;
var cos:Number = Math.cos(radian);
var sin:Number = Math.sin(radian);
var x_2 = Math.cos(radian)*r;
var y_2 = Math.sin(radian)*r;
mc.lineStyle( 0, 0x0000E0, 100);
//mc.beginFill( 0x0000E0, 100 );
mc.moveTo( val.left+(val.bar_width/2), val.y );
mc.lineTo( val.left+(val.bar_width/2)+x_1, val.y+y_1 );
mc.lineTo( val.left+(val.bar_width/2)+x_2, val.y+y_2 );
mc.lineTo( val.left+(val.bar_width/2), val.y );
//mc.endFill();
return mc;
}
}
|