<?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:esri="http://www.esri.com/2008/ags" initialize="application1_initializeHandler(event)"> <fx:Script> <![CDATA[ import com.esri.ags.components.IdentityManager; import com.esri.ags.events.LayerEvent; import com.esri.ags.geometry.MapPoint; import com.esri.ags.layers.TiledMapServiceLayer; import mx.events.FlexEvent; protected function application1_initializeHandler(event:FlexEvent):void { IdentityManager.instance.enabled = true; } private function layerShowHandler(event:FlexEvent):void { // update the LODs/zoomslider to use/show the levels for the selected base map var tiledLayer:TiledMapServiceLayer = event.target as TiledMapServiceLayer; myMap.lods = tiledLayer.tileInfo.lods; } protected function marine_loadHandler(event:LayerEvent):void { myEditor.featureLayers = [ marine ]; myEditor.attributeInspector.fieldInspectors = [ creatorFI, typeFI ]; } ]]> </fx:Script> ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/getChildIndex() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_getChildIndex()at mx.managers::SystemRawChildrenList/getChildIndex() at spark.components.supportClasses::StyleableStageText/getFormIndex() at spark.components.supportClasses::StyleableStageText/findTopmostForm() at spark.components.supportClasses::StyleableStageText/updateProxyImageForTopmostForm() at spark.components.supportClasses::StyleableStageText/commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateClient() at mx.managers::PopUpManagerImpl/addPopUp() at mx.managers::PopUpManagerImpl/createPopUp() at mx.managers::PopUpManager$/createPopUp() at com.esri.ags.components::IdentityManager/popUpSignInWindow() at com.esri.ags.components::IdentityManager/signIn() at com.esri.ags.components::IdentityManager/doSignIn() at com.esri.ags.components::IdentityManager/enqueue() at Function/com.esri.ags.components:IdentityManager/getCredential/com.esri.ags.components:svcInfoResult2() at mx.rpc::Responder/result() at Function/<anonymous>() at MyURLLoader/completeHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete()
Solved! Go to Solution.
I have been running through the flex in a week tutorial and been playing around with developing a flex mobile app using snippets from flex api samples. I found the Secure editing sample, and have been trying to run that in a flex mobile project. However, I am running into an error when I run IdentityManager function in the code:<?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:esri="http://www.esri.com/2008/ags" initialize="application1_initializeHandler(event)"> <fx:Script> <![CDATA[ import com.esri.ags.components.IdentityManager; import com.esri.ags.events.LayerEvent; import com.esri.ags.geometry.MapPoint; import com.esri.ags.layers.TiledMapServiceLayer; import mx.events.FlexEvent; protected function application1_initializeHandler(event:FlexEvent):void { IdentityManager.instance.enabled = true; } private function layerShowHandler(event:FlexEvent):void { // update the LODs/zoomslider to use/show the levels for the selected base map var tiledLayer:TiledMapServiceLayer = event.target as TiledMapServiceLayer; myMap.lods = tiledLayer.tileInfo.lods; } protected function marine_loadHandler(event:LayerEvent):void { myEditor.featureLayers = [ marine ]; myEditor.attributeInspector.fieldInspectors = [ creatorFI, typeFI ]; } ]]> </fx:Script>
I get the runtime error ofArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/getChildIndex() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_getChildIndex()at mx.managers::SystemRawChildrenList/getChildIndex() at spark.components.supportClasses::StyleableStageText/getFormIndex() at spark.components.supportClasses::StyleableStageText/findTopmostForm() at spark.components.supportClasses::StyleableStageText/updateProxyImageForTopmostForm() at spark.components.supportClasses::StyleableStageText/commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateClient() at mx.managers::PopUpManagerImpl/addPopUp() at mx.managers::PopUpManagerImpl/createPopUp() at mx.managers::PopUpManager$/createPopUp() at com.esri.ags.components::IdentityManager/popUpSignInWindow() at com.esri.ags.components::IdentityManager/signIn() at com.esri.ags.components::IdentityManager/doSignIn() at com.esri.ags.components::IdentityManager/enqueue() at Function/com.esri.ags.components:IdentityManager/getCredential/com.esri.ags.components:svcInfoResult2() at mx.rpc::Responder/result() at Function/<anonymous>() at MyURLLoader/completeHandler() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete()
Is this an error due to the creation of a popup window on a cell device or is this just an error due to bad code writing? the code works great in a windowed project, but causes this error on a mobile project. Thanks in advance for helping me understand what is going on!
Clinton
After doing some more research on IdentityManager, I think the issue has something due to do with configuring PopUpManager. But I am not yet there technically to understand it. Thanks!
Also what version of the Flex SDK are you using?
It looks like the error may be coming from StyleableStageText.
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:esri="http://www.esri.com/2008/ags"
initialize="application1_initializeHandler(event)">
<fx:Script>
<![CDATA[
import com.esri.ags.components.IdentityManager;
import com.esri.ags.events.LayerEvent;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.layers.TiledMapServiceLayer;
import mx.events.FlexEvent;
protected function application1_initializeHandler(event:FlexEvent):void
{
IdentityManager.instance.enabled = true;
}
private function layerShowHandler(event:FlexEvent):void
{
// update the LODs/zoomslider to use/show the levels for the selected base map
var tiledLayer:TiledMapServiceLayer = event.target as TiledMapServiceLayer;
myMap.lods = tiledLayer.tileInfo.lods;
}
protected function marine_loadHandler(event:LayerEvent):void
{
myEditor.featureLayers = [ marine ];
myEditor.attributeInspector.fieldInspectors = [ creatorFI, typeFI ];
}
]]>
</fx:Script>
<fx:Declarations>
<esri:Extent id="initialExtent"
xmin="-13449015" ymin="4182302" xmax="-13433803" ymax="4191340">
<esri:SpatialReference wkid="102100"/>
</esri:Extent>
<!-- FieldInspector for the 'creator' field -->
<esri:FieldInspector id="creatorFI"
featureLayer="{marine}"
fieldName="creator"
label="Biologist"/>
<esri:FieldInspector id="typeFI"
featureLayer="{marine}"
fieldName="type"
label="Sighting"/>
</fx:Declarations>
<esri:Map id="myMap"
level="4"
load="myMap.centerAt(new MapPoint(-11713000, 4822000))">
<esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)"
url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
visible="{bb.selectedIndex == 0}"/>
<esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)"
url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
visible="{bb.selectedIndex == 1}"/>
<esri:FeatureLayer id="marine" name="SaveTheBay-Marine"
load="marine_loadHandler(event)"
mode="snapshot"
outFields="[type, confirmed, comments, creator]"
url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/SaveTheBay/FeatureServer/0"/>
</esri:Map>
<s:ButtonBar id="bb"
right="0"
requireSelection="true">
<s:dataProvider>
<s:ArrayList>
<fx:String>Street</fx:String>
<fx:String>Imagery</fx:String>
</s:ArrayList>
</s:dataProvider>
</s:ButtonBar>
<esri:Editor id="myEditor"
width="100%" height="75"
geometryService="{new GeometryService('http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/Geometry/GeometryServer')}"
includeInLayout="false"
map="{myMap}"
visible="true"/>
<esri:Geocoder width="200" height="30"
bottom="5"
horizontalCenter="0"
map="{myMap}"/>
</s:View>