Solved! Go to Solution.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:esri="http://www.esri.com/2008/ags"
pageTitle="Directions component sample">
<fx:Script>
<![CDATA[
import com.esri.ags.SpatialReference;
import com.esri.ags.components.supportClasses.DirectionsStop;
import mx.events.FlexEvent;
protected function dir_creationCompleteHandler(event:FlexEvent):void
{
var stop:DirectionsStop = dir.stopProvider[0];
stop.editable = false;
stop.searchTerm = '1123 Island Ave, San Diego, California, 92102';
var stop2:DirectionsStop = dir.stopProvider[1];
stop2.editable = false;
stop2.searchTerm = '924 S 16th St, San Diego, California, 92102';
var stop3:DirectionsStop = new DirectionsStop();
stop3.searchTerm = '2025 L St, San Diego, California, 92102'
dir.stopProvider.addItem(stop3);
}
]]>
</fx:Script>
<s:layout>
<s:HorizontalLayout paddingLeft="2"/>
</s:layout>
<esri:Directions width="320" height="100%"
map="{map}"
id="dir"
creationComplete="dir_creationCompleteHandler(event)"
url="http://sampleserver6.arcgisonline.com/arcgis/rest/services/NetworkAnalysis/SanDiego/NAServer/Route"/>
<esri:Map id="map">
<esri:extent>
<esri:WebMercatorExtent xmin="-13055785" ymin="3848161" xmax="-13025898" ymax="3866239"
spatialReference="{new SpatialReference(102100)}"/>
</esri:extent>
<esri:ArcGISTiledMapServiceLayer/>
</esri:Map>
</s:Application>