AnsweredAssumed Answered

Clear Graphics when InfoWindow is closed

Question asked by geonetadmin on Oct 28, 2010
Latest reply on Jun 7, 2011 by geonetadmin
Original User: Lynn_Carlson

Any chance someone can help a newbie with the code which would, upon clicking the close button on an InfoWindow, clear the graphics layer?

When I click the map, a red dot is created over the feature layer point and an info window opens with attributes from the feature layer.  When the info window is closed however, the red dot doesn't go away until the next feature is clicked.

I would prefer that the red dot goes away as soon as the info window is closed.

I have this so far:

protected function infoWindowClose(event:InfoWindow):void
{
redDotGraphicsLayer.clear();
}

but I have no idea how to call this function because the InfoWindow doesn't seem to have a way to identify itself.  It doesn't seem to have any properties such as id="......".

BTW - I am not using the Flex Viewer, rather I am creating custom code in Flash Builder, so I have no widgets to edit.

Flash Builder 4, ArcGIS 10, ArcGIS Server 10, Flex API 2.1

Thanks

Outcomes