Mickey
Gaia Novice

Posts: 8
|
 |
« on: June 29, 2011, 05:00:47 AM » |
|
I am trying to use the Google map API in flash
When i put the code provided by google in my flash folder i am getting an error, call of undefined method Point.
This is the code provided by google
import com.google.maps.LatLng; import com.google.maps.Map; import com.google.maps.MapEvent; import com.google.maps.MapType;
var map:Map = new Map(); map.key = "your_api_key"; map.sensor = "true_or_false"; map.setSize(new Point(stage.stageWidth, stage.stageHeight)); map.addEventListener(MapEvent.MAP_READY, onMapReady); this.addChild(map);
function onMapReady(event:Event):void { map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE); }
seeing that i am using the gaia framework, i have tried transalating it to this:
package com.mezzo.pages { import com.gaiaframework.templates.AbstractPage; import com.gaiaframework.events.*; import com.gaiaframework.debug.*; import com.gaiaframework.api.*; import flash.display.*; import flash.events.*; import com.greensock.TweenMax; import com.google.maps.LatLng; import com.google.maps.Map; import com.google.maps.MapEvent; import com.google.maps.MapType; public class ContactPage extends AbstractPage { public var map:Map = new Map();
public function ContactPage() { super(); alpha = 0; } override public function transitionIn():void { super.transitionIn(); TweenMax.to(this, 0.3, {alpha:1, onComplete:transitionInComplete}); map.key = "ABQIAAAA6RfVdhhZiY0vYVJWsVs97BR16Sl5WV4WI7kq5l1CCbZORnxcMhTQz-oQinntj2NJDN5yBIBubPnKjQ"; map.sensor = "true_or_false"; map.setSize(new Point(stage.stageWidth, stage.stageHeight)); map.addEventListener(MapEvent.MAP_READY, onMapReady); this.addChild(map);
} public function onMapReady(event:Event):void { map.setCenter(new LatLng(40.736072,-73.992062), 14, MapType.NORMAL_MAP_TYPE); } override public function transitionOut():void { super.transitionOut(); TweenMax.to(this, 0.3, {alpha:0, onComplete:transitionOutComplete}); } } }
Could anyone please let me know if they see anything wrong with my code
Thanks
|