I have a map service that can be found at http://geoinfo1.lib.uidaho.edu/ArcGIS/rest/services/example_group/MapServer. This is a basic test service that contains groups. I am unable to hide a layer if it has a parent group that is not hidden. I have tested this with the most basic example as shown belowvar dynMapService:ArcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(serviceURL);
dynMapService.id = serviceId;
dynMapService.visible = serviceVisible;
dynMapService.visibleLayers = new ArrayCollection([0]);
map.addLayer(dynMapService);
This code should show no layers at all but instead it shows the first "Development" layer. ArcMap of course works as expected.