Dear all;Am using Flex 4.5.1 on Win XP, mobile project. A simple identify function that identifies polygon landmarks in the map and send the identify results to a new view, and it is driving me crazy. To send variables to a new view, I used this techniquehttp://devgirl.org/2011/08/09/flex-mobile-development-passing-data-between-tabs-part-2-includes-sour...Then modified it every which way to no avail. Main App relevant code: import model.landmarks;
import views.landmarkDetailsWindow;
[Bindable]
public var landmarksVar:landmarks = new landmarks();
landmarks.as code:
package model
{
[Bindable]
public class landmarks
{
public var type:String;
public var name:String;
public function landmarks()
{
this.type = type;
this.name = name;
}
}
}First View relevant code, where the identify happens: [Bindable]private var lastIdentifyResultGraphic:Graphic;
var clickGraphic;
private function identifyClickHandeler(event:MapMouseEvent):void
{
myMap.extent = new Extent(31.192271, 30.043800, 31.219662, 30.073615, null);
var identifyParams:IdentifyParameters = new IdentifyParameters();
identifyParams.returnGeometry = true;
identifyParams.tolerance = 3;
identifyParams.width = myMap.width;
identifyParams.height = myMap.height;
identifyParams.geometry = event.mapPoint;
identifyParams.mapExtent = myMap.extent;
identifyParams.spatialReference = myMap.spatialReference;
identifyTask.execute(identifyParams, new AsyncResponder(myResultFunction, myFaultFunction, clickGraphic));
}
private function myResultFunction(results:Array, clickGraphic:Graphic = null):void
{
var identWinVar:DE_Mobile_App = parentDocument as DE_Mobile_App;
landmarksVar = identWinVar.landmarksVar;
if(result.layerName == "Landmarks")
{
//////The following lines is where I attempt to send the data identified (Type and Name) to the second view
landmarksVar.type =result.feature.attributes["Type"].toString();
landmarksVar.name =result.feature.attributes["Name"].toString();
navigator.pushView(landmarkDetailsWindow);
}
}
}
private function myFaultFunction():void
{
}
<esri:Map id="myMap">
</esri:extent>
<esri:ArcGISTiledMapServiceLayer
url="http://arcgis2.roktech.net/ArcGIS/rest/services/DigitalEg/English_Layered/MapServer"/>
</esri:Map>
<s:Button label="Ident" click="myMap.addEventListener(MapMouseEvent.MAP_CLICK, identifyClickHandeler)"/>
Code for landmarkDetailsWindow: <fx:Script>
<![CDATA[
import model.landmarks;
[Bindable]
public var landmarksVar:landmarks ;
]]>
</fx:Script>
<s:VGroup>
<s:Label text="Type:"/>
<s:Label text="{landmarksVar.type}"/>
<s:Label text="Name:"/>
<s:Label text="{landmarksVar.name}"/>
</s:VGroup>When debugging, you see that identWinVar.landmarksVar.type and .name are assigned the proper values when a landmark polygon is identified...I also tried replacing this linelandmarksVar.type =result.feature.attributes["Type"].toString();
withidentWinVar.landmarksVar.type =result.feature.attributes["Type"].toString();
to no avail. Thanks in advance.