Andrzej, The layer has to be visible to be edited. So you would have to apply a definitionExpression to the FeatureLayer and the expression would have to something like 'NOT ObjectId IN (1,2,3,etc)' an feed the expression the list of current objectids. You would be the list of current ObjectIds by doing an QueryTask.executeForIdsSome thing like this: private var query:Query = new Query;
private var queryTask:QueryTask = new QueryTask();
query.returnGeometry = false;
query.outFields = ["objectid"]
query.objectIds = null;
query.where = "1=1";
queryTask.url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/2";
queryTask.executeForIds(query, new AsyncResponder(onExecuteForIdsComplete, queryTask_faultHandler));
private function onExecuteForIdsComplete(objectIds:Array, token:Object = null):void
{
//Apply a definition expression that removes all the current objectids
//Now you should only have the new features you create visible
incidentsAreas.definitionExpression = "NOT objectid IN (" + objectIds.join(',') + ")";
}
private function queryTask_faultHandler(info:Object, token:Object = null):void
{
//do nothing
}