Hi Amanda- I'd suggest tracing the various variables/properties reference in that function to figure out which one is the null reference. Perhaps it's not getting back a Marker as the selected data?
- pamela On Tue, Dec 9, 2008 at 6:50 PM, Amanda <[email protected]> wrote: > > Not by choice...I have had to adapt the Markers in Grid example to > Flash instead of Flex (having to integrate it with an existing site). > > I have the map showing up with all the markers, you can click the > markers and the correct info windows show up. > > Getting the items in the List/DataGrid to trigger a marker and > infowindow is not working well. > > my code: > ... > > [Bindable] > var acMarkers:DataProvider = new DataProvider(); > var aDg:DataGrid = new DataGrid(); > aDg.width = 150; > aDg.height = 200; > aDg.x = 10; > aDg.y = 10; > aDg.dataProvider = acMarkers; > aDg.addEventListener(Event.CHANGE,nameSelected) > addChild(aDg); > function nameSelected(event:Event):void { > var marker:Marker = aDg.selectedItem.data as Marker; > marker.dispatchEvent(new MapMouseEvent(MapMouseEvent.CLICK,marker, > marker.getLatLng(), true, false)); > } > ... > > I know its all over the place. Not sure if I should use a DataGrid or > a List.... > With the code as-is I get an error > Cannot access a property or method of a null object reference. > at site_fla::MainTimeline/nameSelected() > [site_fla.MainTimeline::frame103:57] > at flash.events::EventDispatcher/dispatchEventFunction() > at flash.events::EventDispatcher/dispatchEvent() > at fl.controls::SelectableList/handleCellRendererClick() > at fl.controls::DataGrid/handleCellRendererClick() > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
