         if (layerCreationProperties.showInLegend
             && layerCreationProperties.showInLegendHiddenLayers)
         {
-            var hiddenLayers:Array = layerCreationProperties.showInLegendHiddenLayers.split(",");
-            for (var i:int = 0; i < hiddenLayers.length; i++)
-            {
-                hiddenLayers[i] = Number(hiddenLayers[i]); // convert to Numbers
-            }
-            dynLayer.showInLegendHiddenLayers = hiddenLayers;
+            dynLayer.showInLegendHiddenLayers = toNumericArray(layerCreationProperties.showInLegendHiddenLayers.split(","));
         }
         if (layerCreationProperties.autoRefresh > 0)
         {

        }
        if (layerCreationProperties.bandIds)
        {
            imgLayer.bandIds = layerCreationProperties.bandIds.split(",");
            for (var i:int = 0; i < imgLayer.bandIds.length; i++)
            {
                imgLayer.bandIds[i] = Number(imgLayer.bandIds[i]); // convert to Numbers
            }
        }
        if (layerCreationProperties.proxyUrl && layerCreationProperties.useProxy)
        {

        if (layerCreationProperties.showInLegend
            && layerCreationProperties.showInLegendHiddenLayers)
        {
            tiledLayer.showInLegendHiddenLayers = toNumericArray(layerCreationProperties.showInLegendHiddenLayers.split(","));
        }
        if (layerCreationProperties.displayLevels)
        {
            tiledLayer.displayLevels = toNumericArray(layerCreationProperties.displayLevels.split(","));
        }
        if (layerCreationProperties.proxyUrl && layerCreationProperties.useProxy)
        {
