DisplayObjectZone presently doesn't calculate proper bounds in that case. I've changed a couple lines in DisplayObjectZone.as which fix the problem. In essence, I use getBounds from the "root" display object ,and then convert those coordinates to renderer coordinates. (Your code used the stage to do that, but didn't work with scaling properly).
/**
* The getLocation method returns a random point inside the zone.
*
* @return a random point inside the zone.
*/
public function getLocation() : Point
{
var bounds:Rectangle = _displayObject.getBounds( _displayObject.root );
do
{
var x : Number = bounds.left + Math.random( ) * bounds.width;
var y : Number = bounds.top + Math.random( ) * bounds.height;
}
while( !_displayObject.hitTestPoint( x, y, true ) );
var point:Point = new Point( x, y );
point = _renderer.globalToLocal( displayObject.root.localToGlobal( point ) );
return point;
}
I should add that without this patch, it gets stuck in the while() loop because hitTestPoint never returns true.]]>