CameraIcon.as 942 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package elements.menu {
  2. import flash.display.Sprite;
  3. import flash.events.MouseEvent;
  4. import flash.external.ExternalInterface;
  5. import flash.text.TextField;
  6. import flash.text.TextFieldType;
  7. import flash.text.TextFormat;
  8. public class CameraIcon extends menuItem {
  9. public function CameraIcon(chartId:String, props:Properties) {
  10. super(chartId, props);
  11. }
  12. protected override function add_elements(): Number {
  13. this.draw_camera();
  14. var width:Number = this.add_text(this.props.get('text'), 35);
  15. return width+30; // 30 is the icon width
  16. }
  17. private function draw_camera():void {
  18. var s:Sprite = new Sprite();
  19. s.graphics.beginFill(0x505050);
  20. s.graphics.drawRoundRect(2, 4, 26, 14, 2, 2);
  21. s.graphics.drawRect(20, 1, 5, 3);
  22. s.graphics.endFill();
  23. s.graphics.beginFill(0x202020);
  24. s.graphics.drawCircle(9, 11, 4.5);
  25. s.graphics.endFill();
  26. this.addChild(s);
  27. }
  28. }
  29. }