 			var graphics:Graphics = g;
 			var anchor1:AnchorPoint;
 			var anchor2:AnchorPoint;
-			var anchors:Array = [];
+			var anchor:AnchorPoint;
+			var _anchors:Array = [];
 			var index:int;
 			var p1:Point = new Point();
 			var p2:Point = new Point();0

			
			graphics.endFill();
			
			function anchorCompareFunctionByPolarAngle(a1:AnchorPoint, a2:AnchorPoint):Boolean
			{
				return a1.polarRadians.value > a2.polarRadians.value;
			}
			
		}

			// convert the array of record keys into array of anchors
			for(index = 0; index < recordKeys.length; index++)
			{
				 anchor = anchors.getObject(recordKeys[index].localName) as AnchorPoint;
				
				if (recordKeys[index].keyType != ANCHOR_KEYTYPE || !anchor)
					continue;
				
				_anchors.push(anchor);
			}
			
			// sort by polar angle
			_anchors.sort(anchorCompareFunctionByPolarAngle);
			
			// draw convex hull
			for(index = 0; index < _anchors.length - 1; index++)
			{
				anchor1 = _anchors[index];
				anchor2 = _anchors[index + 1];
				p1.x = anchor1.x.value; p1.y = anchor1.y.value;
				p2.x = anchor2.x.value;p2.y = anchor2.y.value;
				dataBounds.projectPointTo(p1, screenBounds);
