/flex-sdk/frameworks/projects/haloclassic/src/haloclassic/BusyCursor.as

https://github.com/param108/zflop
ActionScript | 126 lines | 59 code | 20 blank | 47 comment | 0 complexity | 28893dd4dd50d60e1f439f5e5a6509bd MD5 | raw file
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // ADOBE SYSTEMS INCORPORATED
  4. // Copyright 2005-2006 Adobe Systems Incorporated
  5. // All Rights Reserved.
  6. //
  7. // NOTICE: Adobe permits you to use, modify, and distribute this file
  8. // in accordance with the terms of the license agreement accompanying it.
  9. //
  10. ////////////////////////////////////////////////////////////////////////////////
  11. package haloclassic
  12. {
  13. import flash.display.DisplayObject;
  14. import flash.display.Graphics;
  15. import flash.display.InteractiveObject;
  16. import flash.display.Shape;
  17. import flash.display.Sprite;
  18. import flash.events.Event;
  19. import mx.core.FlexShape;
  20. import mx.styles.StyleManager;
  21. /**
  22. * Documentation is not currently available.
  23. * @review
  24. */
  25. public class BusyCursor extends Sprite
  26. {
  27. include "../mx/core/Version.as";
  28. //--------------------------------------------------------------------------
  29. //
  30. // Constructor
  31. //
  32. //--------------------------------------------------------------------------
  33. /**
  34. * Constructor.
  35. */
  36. public function BusyCursor()
  37. {
  38. super();
  39. cursorClass =
  40. StyleManager.getStyleDeclaration("CursorManager").getStyle("busyCursorBackground");
  41. cursorHolder = new cursorClass();
  42. addChild(cursorHolder);
  43. InteractiveObject(cursorHolder).mouseEnabled = false;
  44. var xOff:Number = -0.5;
  45. var yOff:Number = -0.5;
  46. var g:Graphics;
  47. minuteHand = new FlexShape();
  48. minuteHand.name = "minuteHand";
  49. g = minuteHand.graphics;
  50. g.beginFill(0x000000);
  51. g.moveTo(xOff, yOff);
  52. g.lineTo(1 + xOff, 0 + yOff);
  53. g.lineTo(1 + xOff, 5 + yOff);
  54. g.lineTo(0 + xOff, 5 + yOff);
  55. g.lineTo(0 + xOff, 0 + yOff);
  56. g.endFill();
  57. addChild(minuteHand);
  58. hourHand = new FlexShape();
  59. hourHand.name = "hourHand";
  60. g = hourHand.graphics;
  61. g.beginFill(0x000000);
  62. g.moveTo(xOff, yOff);
  63. g.lineTo(4 + xOff, 0 + yOff);
  64. g.lineTo(4 + xOff, 1 + yOff);
  65. g.lineTo(0 + xOff, 1 + yOff);
  66. g.lineTo(0 + xOff, 0 + yOff);
  67. g.endFill();
  68. addChild(hourHand);
  69. addEventListener(Event.ENTER_FRAME, enterFrameHandler);
  70. }
  71. //--------------------------------------------------------------------------
  72. //
  73. // Variables
  74. //
  75. //--------------------------------------------------------------------------
  76. /**
  77. * @private
  78. */
  79. private var cursorClass:Class;
  80. /**
  81. * @private
  82. */
  83. private var cursorHolder:DisplayObject;
  84. /**
  85. * @private
  86. */
  87. private var minuteHand:Shape;
  88. /**
  89. * @private
  90. */
  91. private var hourHand:Shape;
  92. //--------------------------------------------------------------------------
  93. //
  94. // Event handlers
  95. //
  96. //--------------------------------------------------------------------------
  97. /**
  98. * @private
  99. */
  100. private function enterFrameHandler(event:Event):void
  101. {
  102. minuteHand.rotation += 12;
  103. hourHand.rotation += 1;
  104. }
  105. }
  106. }