This is an editor for examine regions. It's written in AS3.
import flash.display.MovieClip;
import flash.ui.Mouse;
import flash.events.MouseEvent;
import flash.display.Loader;
import flash.events.Event;
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressStatus);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderReady);
var pbar:MovieClip;
var crect:MovieClip;
var cursor:MovieClip;
btn.addEventListener(MouseEvent.MOUSE_DOWN, loadMap)
function loadMap(e:*=null) {
pbar = new MovieClip();
addChild(pbar);
pbar.graphics.beginFill(0x0099FF);
pbar.graphics.drawRect(10,191-10,236,1);
pbar.graphics.endFill();
pbar.scaleX=0;
//trace(String(bob.text).substr(0,bob.text.length-1)+"");
var url:String=String(bob.text).substr(0,bob.text.length-1);
if (url.indexOf(".") == -1) {
url+=".png"
}
trace(url);
var fileRequest:URLRequest = new URLRequest(url);
myLoader.load(fileRequest);
}
function onProgressStatus(e:ProgressEvent) {
// this is where progress will be monitored
//trace(e.bytesLoaded, e.bytesTotal);
pbar.scaleX=e.bytesLoaded/e.bytesTotal;
}
function onLoaderReady(e:Event) {
// the image is now loaded, so let's add it to the display tree!
removeChild(pbar);
removeChild(btn);
removeChild(bob);
addChild(myLoader);
crect=new MovieClip();
cursor=new MovieClip();
flash.ui.Mouse.hide();
addChild(cursor);
addChild(crect);
cursor.mouseChildren=false;
cursor.mouseEnabled=false;
crect.mouseChildren=false;
crect.mouseEnabled=false;
myLoader.addEventListener(MouseEvent.MOUSE_MOVE,update);
myLoader.addEventListener(MouseEvent.MOUSE_DOWN,m_down);
myLoader.addEventListener(MouseEvent.MOUSE_UP,m_up);
myLoader.addEventListener(Event.ENTER_FRAME,eframe);
}
var sx:int=-1;
var sy:int=-1;
function update(e:MouseEvent) {
cursor.graphics.clear();
cursor.graphics.beginFill(0x0099FF);
cursor.graphics.drawRect(myLoader.mouseX,0,1,192);
cursor.graphics.drawRect(0,myLoader.mouseY,256,1);
cursor.graphics.endFill();
if (sx != -1) {
crect.graphics.clear();
crect.graphics.beginFill(0xFFFFFF,0.5);
crect.graphics.drawRect(sx,sy,myLoader.mouseX-sx,myLoader.mouseY-sy);
crect.graphics.endFill();
}
}
function m_down(e:MouseEvent) {
sx=myLoader.mouseX;
sy=myLoader.mouseY;
}
function m_up(e:MouseEvent) {
if (sx != -1) {
var xx:int=Math.min(sx,myLoader.mouseX);
var yy:int=Math.min(sy,myLoader.mouseY);
var x2:int=Math.max(sx,myLoader.mouseX);
var y2:int=Math.max(sy,myLoader.mouseY);
trace("region "+xx.toString()+" "+yy.toString()+" "+(x2-xx).toString()+" "+(y2-yy).toString()+" LABEL");
}
sx=sy=-1;
crect.graphics.clear();
}
var time:int=0;
function eframe(e:Event) {
time=(time+2)%100;
crect.alpha=Math.sin(time*(Math.PI/50))/3+0.666;
}
You need two things in your stage: A textbox called "bob" (don't know why I named it that) and a button named "btn" (stands for button). Just input the name of your map in the "bob" textbox and click the "btn".
How to use: Go to pywright wiki, and go to tutorials, INTERMEDIATE TUTORIALS (My category), and then Investigation Tutorial. It tells you how to use it.