`

Hide Copyright in Google Map

阅读更多

 

/**
 * http://blog.duncanhall.net/2010/03/google-maps-flash-api-selectable-copyright-text/
 */ 
private function hideGoogleMapCopyrightHack(_map : Object) : void
{
	var container : DisplayObjectContainer = _map.getChildAt(5) as DisplayObjectContainer;
	var numChildren : int = container.numChildren;
	var child : *;

	for (var i : int = 0; i < numChildren; i++)
	{
		child = container.getChildAt(i);

		if (getQualifiedClassName(child) == "com.google.maps.controls::CopyrightView")
		{
			var textfield : TextField = child.getChildAt(0) as TextField;
		//	textfield.selectable = false;
			textfield.visible	= false;
			break;
		}
	}
}

/**
 * http://riaevolution.wordpress.com/2009/11/01/removehide-google-map-copyright-text-hack/
 */ 
private function hideGoogleMapCopyrightHack(map : Object) : void
{
	var nch : int = map.numChildren;
	var n0 : Object;
	var n1 : Object;

	while (nch > 0)
	{
		var t : Object = map.getChildAt(nch - 1);

		if (t.hasOwnProperty('getChildAt') && t is WrappableSprite)
		{
			if (t.numChildren > 0)
			{
				n0 = t.getChildAt(0); //si es el CopyrightView, este tiene el texto de copy dentro

				if (n0.toString() == "[object CopyrightView]")
				{
					n1 = n0.getChildAt(0);

					if (n1 is TextField)
					{
						trace("## Removi el GoogleMap Copyrigth.text##" + n1);
						n1.visible = false;
						break;
					}
				}
			}
		}
		nch--;
	}
}
 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics