So, I assume your custom component is a detailInfoWin ?

if so, you need to pass the data in to this new component. If the code at the 
end of your post is part of this component, then you can do something like...

infoWin.myarray = [data to pass in]

after you create the new instance

--- In flexcoders@yahoogroups.com, "hanx_gen3" <hanx_g...@...> wrote:
>
> 
> hello all, I'm new to flex and google maps..and trying to create an
> application which store places data into the database. I'm using
> AMFPHP services to manipulate the data..
> 
> I have succeeded populating marker trough the data I've stored and
> now
> I'm planning to make like this: when user click the marker, it's
> popup
> a tile window component which contain the detail (or more data) of the
> clicked marker/place… The tile window component popup correctly but
> the problem is the data of clicked marker 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 = "" + name + "
> Alamat: " + address
> "
> 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 //
> <![CDATA[
> import mx.collections.ArrayCollection;
> import mx.managers.PopUpManager;
> [Bindable] public var myarray:ArrayCollection = new
> ArrayCollection([{name:"",
> address:"", type:""}]);
> public var i:Number;
> ]]>
> 
> I'm also using info window to show less data inside info window
> tooltip when user rollover the marker..and it's works fine…
> 
> so, is there any way to make the data show correctly in the tile window
> component of clicked marker/place…please help me…thanks
> before…
>


Reply via email to