//Add this import import com.esri.viewer.components.toc.tocClasses.TocMapLayerItem; //Add this to the very end of the init function callLater(expandTOC); //Add this new function private function expandTOC():void { toc.openItems = toc.dataProvider.source; for each(var item:TocMapLayerItem in toc.openItems) { if (item.isTopLevel()){ toc.expandItem(item, true); } } }
<operationallayers>
<layer label="stuff" type="dynamic" visible="true" alpha=".5" url="http://severname/arcgis/services/test_maps/stuff/MapServer"/>
</operationallayers>
Thanks!