i have this code on first frame
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
stage.addEventListener(Event.RESIZE, resizeHandler);
function mouseUpHandler(param1:MouseEvent) : void
{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
return;
}
function mouseMoveHandler(param1:MouseEvent) : void
{
var _loc_2:Graphics;
_loc_2 = graphics;
_loc_2.lineStyle(10, 6710784);
_loc_2.lineTo(stage.mouseX, stage.mouseY);
return;
}
function mouseDownHandler(param1:MouseEvent) : void
{
var _loc_2:Graphics;
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
_loc_2 = graphics;
_loc_2.moveTo(stage.mouseX, stage.mouseY);
return;
}
function refreshUI() : void
{
clickToDraw_mc.x = stage.stageWidth / 2 - clickToDraw_mc.width / 2;
clickToDraw_mc.y = stage.stageHeight / 2 - clickToDraw_mc.height / 2;
return;
}
function resizeHandler(param1:Event) : void
{
refreshUI();
return;
}
and this works perfecly…i can draw with mouse all over stage…but when i import image (handball field) and drag picture on stage i can only draw beneath this picture…my question how can i reference in AS3 code to draw on that imported picture…i wanna do something like whiteboard for coaches so they can draw actions for game…