Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Whitespace

  • Loading branch information...
commit 74f3f39039f6f683eba4468f0ff75c9945e6318f 1 parent 9811ea1
@kneath kneath authored
Showing with 10 additions and 10 deletions.
  1. +10 −10 Clippy.hx
View
20 Clippy.hx
@@ -14,46 +14,46 @@ class Clippy {
var copyto:String = flash.Lib.current.loaderInfo.parameters.copyto;
if(copied == null){ copied = "copied!";};
if(copyto == null){ copyto = "copy to clipboard";};
-
+
// label
-
+
var label:TextField = new TextField();
var format:TextFormat = new TextFormat("Arial", 10);
-
+
label.text = copyto;
label.setTextFormat(format);
label.textColor = 0x888888;
label.selectable = false;
label.x = 15;
label.visible = false;
-
+
flash.Lib.current.addChild(label);
-
+
// button
-
+
var button:SimpleButton = new SimpleButton();
button.useHandCursor = true;
button.upState = flash.Lib.attach("button_up");
button.overState = flash.Lib.attach("button_over");
button.downState = flash.Lib.attach("button_down");
button.hitTestState = flash.Lib.attach("button_down");
-
+
button.addEventListener(MouseEvent.MOUSE_UP, function(e:MouseEvent) {
flash.system.System.setClipboard(ExternalInterface.call("(function(id){if(document.getElementById(id)){ return(document.getElementById(id).innerHTML) }else{alert('WARN: ' + id + ' Not found ');}})",id));
label.text = copied;
label.setTextFormat(format);
});
-
+
button.addEventListener(MouseEvent.MOUSE_OVER, function(e:MouseEvent) {
label.visible = true;
});
-
+
button.addEventListener(MouseEvent.MOUSE_OUT, function(e:MouseEvent) {
label.visible = false;
label.text = copyto;
label.setTextFormat(format);
});
-
+
flash.Lib.current.addChild(button);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.