下面的代码是 读取xml是的 url连接 和xml里面的第一个title的显示
下面是script的完整代码 实现点的自定义位置高亮显示和闪烁
private var graphicslayer:GraphicsLayer=new GraphicsLayer();
public function init():void
{
myService.send();
map.addLayer(graphicslayer);
this.map.addEventListener(ZoomEvent.ZOOM_END,mouseZ);
var t:Timer = new Timer( 500,20 );
t.addEventListener( TimerEvent.TIMER, onTimer );
t.start();
}
public function mouseZ(event:ZoomEvent):void
{
if(this.map1.visible == false)
{
this.map1.visible =true;
var mapPoint:MapPoint =new MapPoint();
mapPoint.x =121.123123;
mapPoint.y =31.12341;
this.map.centerAt(mapPoint);
this.map.scale = 1800000;
}
}
public function onTimer(event:Event):void
{
graphicslayer.clear();
var mapPoint:MapPoint =new MapPoint();
mapPoint.x =121.123123;
mapPoint.y =31.12341;
var simpleMarkerS:SimpleMarkerSymbol=new SimpleMarkerSymbol();
simpleMarkerS.color=0x00FF00;
simpleMarkerS.size =10;
// circle园 triangle三角 square方形 diamond菱形 cross十字 X
simpleMarkerS.style ="circle";
var graphics:Graphic=new Graphic();
graphics.symbol =simpleMarkerS;
graphics.geometry =mapPoint;
graphicslayer.add(graphics);
}
[Bindable]
private var myData:ArrayCollection;
private function resultHandler(event:ResultEvent):void {
myData = event.result.books.item;
}