fix minor breakage
authorRichard Fairhurst <richard@systemed.net>
Mon, 4 Oct 2010 14:29:35 +0000 (14:29 +0000)
committerRichard Fairhurst <richard@systemed.net>
Mon, 4 Oct 2010 14:29:35 +0000 (14:29 +0000)
net/systemeD/halcyon/EntityUI.as
net/systemeD/halcyon/NodeUI.as
net/systemeD/halcyon/WayUI.as

index a6d6b45..961d874 100644 (file)
@@ -14,7 +14,8 @@ package net.systemeD.halcyon {
                protected var entity:Entity;
                protected var styleList:StyleList;                              // current StyleList for this entity
                protected var sprites:Array=new Array();                // instances in display list
-        protected var listenSprite:Sprite=new Sprite();        // clickable sprite to receive events
+               protected var listenSprite:Sprite=new Sprite(); // clickable sprite to receive events
+               protected var hitzone:Sprite;                                   // hitzone for above
                protected var stateClasses:Object=new Object(); // special context-sensitive classes, e.g. :hover
                protected var layer:int=0;                                              // map layer
                protected var suspended:Boolean=false;                  // suspend redrawing?
@@ -112,7 +113,7 @@ package net.systemeD.halcyon {
             }
                }
 
-               protected function setListenSprite(hitzone:Sprite):void {
+               protected function setListenSprite():void {
                        var l:Sprite=paint.getHitSpriteAt(layer);
                        var s:Sprite;
                        if (entity is Way) { s=l.getChildAt(0) as Sprite; }
@@ -136,6 +137,7 @@ package net.systemeD.halcyon {
                                if (d.parent) { d.parent.removeChild(d); }
                        }
                        listenSprite.hitArea=null;
+                       hitzone=null;
                }
 
                protected function offsetSprites(x:Number, y:Number):void {
index fb825b6..eb9e608 100644 (file)
@@ -147,12 +147,12 @@ package net.systemeD.halcyon {
                }
 
                private function addHitSprite(w:uint):void {
-            var hitzone:Sprite = new Sprite();
+            hitzone = new Sprite();
             hitzone.graphics.lineStyle(4, 0x000000, 1, false, "normal", CapsStyle.ROUND, JointStyle.ROUND);
                        hitzone.graphics.beginFill(0);
                        hitzone.graphics.drawRect(0,0,w,w);
                        hitzone.visible = false;
-                       setListenSprite(hitzone);
+                       setListenSprite();
                }
 
                private function loadedIcon(event:Event):void {
index f38f6ba..b9e3d4d 100755 (executable)
@@ -18,7 +18,6 @@ package net.systemeD.halcyon {
                public var centroid_x:Number;                           // centroid
                public var centroid_y:Number;                           //  |
                public var heading:Array=new Array();           // angle at each node
-        private var hitzone:Sprite;
                public var nameformat:TextFormat;
                private var recalculateDue:Boolean=false;
 
@@ -303,7 +302,7 @@ package net.systemeD.halcyon {
                    hitzone.graphics.lineStyle(maxwidth, 0x000000, 1, false, "normal", CapsStyle.ROUND, JointStyle.ROUND);
                    solidLines(hitzone.graphics,[]);
                    hitzone.visible = false;
-                               setListenSprite(hitzone);
+                               setListenSprite();
                        }
 
                        return true;