var clickedGraphic:Graphic = new Graphic(); clickedGraphic = event.target as Graphic; trace("click: " + clickedGraphic.attributes.toString());
for each (var graphic:Graphic in featureSet.features) { graphic.toolTip = "Site ID: " + graphic.attributes["Site_ID"]; graphic.addEventListener(MouseEvent.ROLL_OVER, onMouseOver); //you could also add MouseEvent.CLICK graphic.id = "Dive"; }
private function onMouseOver(event:MouseEvent):void { var graphic:Graphic = Graphic(event.target); var objectid = graphic.attributes["OBJECTID"] //etc
protected function onGraphicMouseClick(event:MouseEvent):void { var clickedGraphic:Graphic = Graphic(event.target); trace("event.target = " + event.target.toString()); }
TypeError: Error #1034: Type Coercion failed: cannot convert CompositeSymbolComponent@16e429e1 to com.esri.ags.Graphic.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.