I am trying to get information about a particular point layer on mouse over. But I notice how they are doing the code is only because they put a listner on the new symbol they added. Is there away to keep my original symbol without alternating the color.here is the code. The code works great if you didn't care for the original color of the symbol.But I want the original color of my layer because it changes color. protected function fLayer_graphicAddHandler(event:GraphicEvent):void
{
event.graphic.addEventListener(MouseEvent.MOUSE_OVER, onMouseOverHandler);
event.graphic.addEventListener(MouseEvent.MOUSE_OUT, onMouseOutHandler);
}
private function onMouseOverHandler(event:MouseEvent):void
{
var gr:Graphic = Graphic(event.target);
gr.symbol = mouseOverSymbol;
myTextArea.textFlow = TextFlowUtil.importFromString("<span fontWeight='bold'>2000 Population: </span>" + gr.attributes.StateID.toString() + "<br/>"
+ "<span fontWeight='bold'>2000 Population per Sq. Mi.: </span>" + gr.attributes.FirstName + "<br/>"
+ "<span fontWeight='bold'>2007 Population: </span>" + gr.attributes.LastName + "<br/>"
+ "<span fontWeight='bold'>2007 Population per Sq. Mi.: </span>" + gr.attributes.FULLADDRESS);
myMap.infoWindow.label = gr.attributes.FirstName;
myMap.infoWindow.closeButtonVisible = false;
myMap.infoWindow.show(myMap.toMapFromStage(event.stageX, event.stageY));
}
private function onMouseOutHandler(event:MouseEvent):void
{
var gr:Graphic = Graphic(event.target);
gr.symbol = null;
myMap.infoWindow.hide();
}
<esri:FeatureLayer id="fLayer"
graphicAdd="fLayer_graphicAddHandler(event)"
mode="snapshot"
outFields="*"
url="http://67.78.127.3:6080/arcgis/rest/services/STEARWEBMAPTEST/FeatureServer/0"/>
<esri:SimpleMarkerSymbol id="mouseOverSymbol"
alpha="0.9"
color="#0000FF"
size="11"
style="square">
</esri:SimpleMarkerSymbol>
<esri:SimpleMarkerSymbol id="defaultsym" alpha="0.1" >
</esri:SimpleMarkerSymbol>