summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/editing/dnd/platform/plugin/swfsources/mouseup.hx
blob: 13a8757bd79bf20a3c90cf0b49fd96b938aedaf2 (plain)
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
import flash.Lib;
import flash.display.Sprite;
import flash.events.MouseEvent;

class MouseUp extends Sprite
{
  var s:Sprite;

  static function main()
  {
    new MouseUp();
  }

  public function new()
  {
    super();
    flash.Lib.current.addChild(this);

    s = new Sprite();
    s.graphics.beginFill(0xffa500);
    s.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
    s.graphics.endFill();
    stage.addChild(s);

    stage.addEventListener(MouseEvent.MOUSE_UP, OnMouseUp);
  }

  function OnMouseUp(event:MouseEvent):Void
  {
    s.graphics.beginFill(0xffee00);
    s.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
    s.graphics.endFill();
  }
}