Yeah I decided to make the api key the only required param and moved
it to the main class. It was the addChild that was the problem.
Thanks for your help. I seem to be moving a long much better now.
Jesse
package lib{
import flash.display.MovieClip;
import flash.events.Event;
import flash.geom.Point;
import com.google.maps.Map;
import com.google.maps.MapEvent;
import com.google.maps.MapType;
import com.google.maps.LatLng;
public class GoogleMap extends MovieClip {
public var map:Map;
public var mapWidth:Number;
public var mapHeight:Number;
public var _callBack:Function;
public function GoogleMap(apiKey, width = null, height = null,
callBack:Function = null) {
mapWidth = width;
mapHeight = height;
_callBack = callBack
map = new Map();
map.key = apiKey;
map.addEventListener(MapEvent.MAP_READY, onMapReady);
addChild(map);
}
private function onMapReady(event:MapEvent):void {
if (!mapWidth)
{mapWidth = stage.stageWidth; }
if (!mapHeight)
{mapHeight = stage.stageHeight; }
map.setSize(new Point(mapWidth, mapHeight));
map.setCenter(new LatLng(40.736072, -73.992062), 14,
MapType.NORMAL_MAP_TYPE);
}
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---