Hi Bhupender- Perhaps it was due to the error which I mentioned a fix for in the other thread.
- pamela On Wed, Nov 26, 2008 at 6:16 PM, Bhupender <[EMAIL PROTECTED]> wrote: > > Hi, > > I copied GeocodingSimple.mxml and tried to run it locally. It did not > run . Only a screen with grey background appears. > > Can anybody tell me the problem/solution. > > <?xml version="1.0" encoding="utf-8"?> > <!-- Copyright 2007 Google Inc. --> > <!-- All Rights Reserved. --> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > xmlns:maps="com.google.maps.*" > width="100%" height="100%" layout="absolute"> > <mx:Panel title="Google Maps Geocoding Demo" width="100%" > height="100%"> > <mx:VBox width="100%" height="100%"> > <mx:HBox width="100%" height="25"> > <mx:Label > text="Enter address: "/> > <mx:TextInput > id="address" > text="Sydney AU" > dropShadowColor="0x000000" > enter="doGeocode(event);" > /> > <mx:Button > id="submitButton" label="Search" > click="doGeocode(event);" > /> > </mx:HBox> > <maps:Map > id="map" > key="Key used" > mapevent_mapready="onMapReady(event)" > width="100%" height="100%"/> > </mx:VBox> > </mx:Panel> > <mx:Script> > <![CDATA[ > import com.google.maps.LatLng; > import com.google.maps.Map; > import com.google.maps.MapEvent; > import com.google.maps.MapMouseEvent; > import com.google.maps.MapType; > import com.google.maps.services.ClientGeocoder; > import com.google.maps.services.GeocodingEvent; > import com.google.maps.overlays.Marker; > import com.google.maps.overlays.MarkerOptions; > import com.google.maps.InfoWindowOptions; > import mx.controls.Alert; > import com.google.maps.controls.ZoomControl; > > private function onMapReady(event:Event):void { > map.enableScrollWheelZoom(); > map.enableContinuousZoom(); > map.addControl(new ZoomControl()); > } > > private function doGeocode(event:Event):void { > // Geocoding example > var geocoder:ClientGeocoder = new ClientGeocoder("AU"); > geocoder.addEventListener( > GeocodingEvent.GEOCODING_SUCCESS, > function(event:GeocodingEvent):void { > var placemarks:Array = event.response.placemarks; > if (placemarks.length > 0) { > map.setCenter(placemarks[0].point); > var marker:Marker = new Marker(placemarks[0].point); > > marker.addEventListener(MapMouseEvent.CLICK, function > (event:MapMouseEvent):void { > marker.openInfoWindow(new InfoWindowOptions({content: > placemarks[0].address})); > }); > map.addOverlay(marker); > } > }); > geocoder.addEventListener( > GeocodingEvent.GEOCODING_FAILURE, > function(event:GeocodingEvent):void { > Alert.show("Geocoding failed"); > trace(event); > trace(event.status); > }); > geocoder.geocode(address.text); > } > ]]> > </mx:Script> > </mx:Application> > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
