ok now the data values appear, but the problem is that it's only
display the same data values on any clicked marker ..

so how to display the right data values on each clicked marker?...
here is my code :

// to retrieve data from amfphp result //
                private function getResultHandler(re:ResultEvent):void{
                        var res:Array = re.result as Array;
                        resultData= new ArrayCollection(res);
                        }

// populate marker to map //
        public function addMarker(event:Event):void{
                var markersCount:int = resultData.length;
                var i:Number;
                for (i=0; i < markersCount; i++) {
                        var name:String = resultData[i]['name'];
                        var address:String = resultData[i]['address'];
                        var type:String = resultData[i]['type'];
                        var latlng:LatLng = new LatLng(resultData[i]['lat'], 
resultData[i]
['long']);
                        var marker:Marker = createMarker(latlng, name, address, 
type);
                        infoWin.myarray.addItemAt({name:resultData[i]['name'],
address:resultData[i]['address'], type:resultData[i]['type']},i);
                        map.addOverlay(marker);
                }
        }

// create marker //
      public function createMarker(latlng:LatLng, name:String,
address:String, type:String): Marker {
        var marker:Marker = new Marker(latlng, new MarkerOptions
({iconOffset: new Point(-16, -32)}));
        var html:String = "<b>" + name + "</b> <br/>Alamat: " + address
+"<br/>Tipe: "+type;

        marker.addEventListener(MapMouseEvent.ROLL_OVER,
        function(e:MapMouseEvent):void {
          marker.openInfoWindow(new InfoWindowOptions
({contentHTML:html}));
        });

        marker.addEventListener(MapMouseEvent.ROLL_OUT,
        function(e:MapMouseEvent):void {
          marker.closeInfoWindow();
        });

        marker.addEventListener(MapMouseEvent.CLICK,showInfo);

        return marker;
     }

// show tile window component popup //
         public function showInfo(event:MapMouseEvent):void {
         var infoWin:detailInfoWin = new detailInfoWin();
          PopUpManager.addPopUp(infoWin,panel1,false);
                  PopUpManager.centerPopUp(infoWin);
                  var i:Number;
        }

// and here is my custom component //
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml";
        layout="absolute" width="400" height="300" title="Detail"
        showCloseButton="true" close="PopUpManager.removePopUp(this)">
        <mx:Label x="20" y="10" text="Label"/>
        <mx:Label x="75" y="10"  id="nametxt" text="{myarray.getItemAt(i)
['name']}"/>
        <mx:Label x="20" y="36" text="Label"/>
        <mx:Label x="75" y="36"  id="addresstxt" text="{myarray.getItemAt(i)
['address']}"/>
        <mx:Label x="20" y="62" text="Label"/>
        <mx:Label x="75" y="62"  id="typetxt" text="{myarray.getItemAt(i)
['type']}"/>
                <mx:Script>
                <![CDATA[
                        import mx.collections.ArrayCollection;
                        import mx.managers.PopUpManager;

                        [Bindable]
                        public var myarray:ArrayCollection = new 
ArrayCollection([{name:"",
address:"", type:""}]);
                        public var i:Number;
                ]]>
        </mx:Script>

</mx:TitleWindow>


?????


On Dec 21, 12:18 am, hanx <[email protected]> wrote:
> I'll try first...

--

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.


Reply via email to