source: code/Website/open-flash-chart/charts/series/dots/Hollow.as@ 7849

Last change on this file since 7849 was 7849, checked in by dennisw, 15 years ago
File size: 1.5 KB
Line 
1package charts.series.dots {
2
3 import charts.series.dots.PointDotBase;
4 import flash.display.BlendMode;
5 import flash.display.Sprite;
6 import string.Utils;
7
8 public class Hollow extends PointDotBase {
9
10 public function Hollow( index:Number, style:Properties ) {
11 // tr.aces('h i', index);
12 super( index, style );
13
14 var colour:Number = string.Utils.get_colour( style.get('colour') );
15
16 this.graphics.clear();
17 //
18 // fill a big circle
19 //
20 this.graphics.lineStyle( 0, 0, 0 );
21 this.graphics.beginFill( colour, 1 );
22 this.graphics.drawCircle( 0, 0, style.get('dot-size'));
23 //
24 // punch out the hollow circle:
25 //
26 this.graphics.drawCircle( 0, 0, style.get('dot-size')-style.get('width'));
27 this.graphics.endFill(); // <-- LOOK
28 //
29 // HACK: we fill an invisible circle over
30 // the hollow circle so the mouse over
31 // event fires correctly (even when the
32 // mouse is in the hollow part)
33 //
34 this.graphics.lineStyle( 0, 0, 0 );
35 this.graphics.beginFill(0, 0);
36 this.graphics.drawCircle( 0, 0, style.get('dot-size') );
37 this.graphics.endFill();
38 //
39 // MASK
40 //
41 var s:Sprite = new Sprite();
42 s.graphics.lineStyle( 0, 0, 0 );
43 s.graphics.beginFill( 0, 1 );
44 s.graphics.drawCircle( 0, 0, style.get('dot-size') + style.get('halo-size') );
45 s.blendMode = BlendMode.ERASE;
46
47 this.line_mask = s;
48 this.attach_events();
49
50 }
51 }
52}
53
Note: See TracBrowser for help on using the repository browser.