Create an overlay button in actionscript 2.0

I needed to create a button that could be used over and over again without the need of creating layers.

This is a simple yet crude way of creating a button on the entire movie:

_root.createEmptyMovieClip("overlayButton", _root.getNextHighestDepth());

overlayButton.beginFill(0x000000, 0);
overlayButton.lineStyle(1, 0x000000, 0,true,"normal","none", "miter");
overlayButton.moveTo(0,0);
overlayButton.lineTo(Stage.width,  0);
overlayButton.lineTo(Stage.width, Stage.height);
overlayButton.lineTo(  0, Stage.height);
overlayButton.lineTo(  0,  0);
overlayButton.endFill()
overlayButton.top = 0;
overlayButton.left = 0;
overlayButton.onRelease = function (){
	getURL("http://www.effxdesign.com", "_blank");
}
Share this