explicitly remove listensprite
authorRichard Fairhurst <richard@systemed.net>
Fri, 18 Feb 2011 08:50:00 +0000 (08:50 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 18 Feb 2011 08:50:00 +0000 (08:50 +0000)
net/systemeD/halcyon/EntityUI.as
net/systemeD/halcyon/MapPaint.as

index ae7efac1f54b025ef5a51c3fe3a933cfc2183af3..d5fb8f4cf6fb7cbfde5cdc2a659b8d8981580c66 100644 (file)
@@ -179,6 +179,13 @@ package net.systemeD.halcyon {
                        }
                }
                
+               public function removeListenSprite():void {
+                       if (listenSprite && listenSprite.parent) listenSprite.parent.removeChild(listenSprite);
+                       if (hitzone && hitzone.parent) hitzone.parent.removeChild(hitzone);
+                       listenSprite=null;
+                       hitzone=null;
+               }
+               
                public function protectSprites():void { clearLimit=sprites.length; }
                public function unprotectSprites():void { clearLimit=0; }
 
index 7cee4d3518edd8a1c155280f60bdccb904d295b0..91cac5c56616fb4b2e7aaaf59c72616b455cc54a 100644 (file)
@@ -221,6 +221,7 @@ package net.systemeD.halcyon {
                                wayuis[way.id].redrawMultis();
                                wayuis[way.id].removeSprites();
                                wayuis[way.id].removeEventListeners();
+                               wayuis[way.id].removeListenSprite();
                                delete wayuis[way.id];
                        }
                        for (var i:uint=0; i<way.length; i++) {
@@ -254,6 +255,7 @@ package net.systemeD.halcyon {
                        if (!nodeuis[node.id]) { return; }
                        nodeuis[node.id].removeSprites();
                        nodeuis[node.id].removeEventListeners();
+                       nodeuis[node.id].removeListenSprite();
                        delete nodeuis[node.id];
                }
 
@@ -282,6 +284,7 @@ package net.systemeD.halcyon {
             if (!markeruis[marker.id]) { return; }
             markeruis[marker.id].removeSprites();
             markeruis[marker.id].removeEventListeners();
+            markeruis[marker.id].removeListenSprite();
             delete markeruis[marker.id];
         }