show clickarea while editing

This commit is contained in:
Jeremy Penner 2011-08-22 17:49:55 -04:00
parent 6647da51d0
commit bc576d08b5

View file

@ -13,6 +13,7 @@ package
private var videotube:Videotube; private var videotube:Videotube;
private var gamedisc:Gamedisc; private var gamedisc:Gamedisc;
private var sketchShape:SketchShape; private var sketchShape:SketchShape;
private var clickarea:ClickArea;
public function GameEditor(videotube:Videotube, gamedisc:Gamedisc) public function GameEditor(videotube:Videotube, gamedisc:Gamedisc)
{ {
@ -30,6 +31,10 @@ package
addChild(sketchShape); addChild(sketchShape);
sketchShape.addEventListener(SketchShape.DRAW_BEGIN, onDrawBegin); sketchShape.addEventListener(SketchShape.DRAW_BEGIN, onDrawBegin);
sketchShape.addEventListener(SketchShape.DRAW_END, onDrawEnd); sketchShape.addEventListener(SketchShape.DRAW_END, onDrawEnd);
clickarea = null;
videotube.addEventListener(EventQte.QTE, onQteBegin);
videotube.addEventListener(EventQte.QTE_TIMEOUT, onQteEnd);
} }
public function cleanup(e: Event):void public function cleanup(e: Event):void
{ {
@ -38,6 +43,16 @@ package
sketchShape.removeEventListener(SketchShape.DRAW_BEGIN, onDrawBegin); sketchShape.removeEventListener(SketchShape.DRAW_BEGIN, onDrawBegin);
sketchShape.removeEventListener(SketchShape.DRAW_END, onDrawEnd); sketchShape.removeEventListener(SketchShape.DRAW_END, onDrawEnd);
} }
public function onQteBegin(e: EventQte):void
{
clickarea = new ClickArea(e.qte.rgpoint, 0x4444ee, 0.4);
addChild(clickarea);
}
public function onQteEnd(e: EventQte):void
{
removeChild(clickarea);
clickarea = null;
}
public function onKeyUp(key: KeyboardEvent):void public function onKeyUp(key: KeyboardEvent):void
{ {