         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
-            }
-            tiledLayer.showInLegendHiddenLayers = hiddenLayers;
+            tiledLayer.showInLegendHiddenLayers = toNumericArray(layerCreationProperties.showInLegendHiddenLayers.split(","));
         }
         if (layerCreationProperties.displayLevels)
         {
-            tiledLayer.displayLevels = layerCreationProperties.displayLevels.split(",");
-            for (var i:int = 0; i < tiledLayer.displayLevels.length; i++)
-            {
-                tiledLayer.displayLevels[i] = Number(tiledLayer.displayLevels[i]); // convert to Numbers
-            }
+            tiledLayer.displayLevels = toNumericArray(layerCreationProperties.displayLevels.split(","));
         }
         if (layerCreationProperties.proxyUrl && layerCreationProperties.useProxy)
         {

        }
        if (layerCreationProperties.displayLevels)
        {
            webTiledLayer.displayLevels = layerCreationProperties.displayLevels.split(",");
            for (var i:int = 0; i < webTiledLayer.displayLevels.length; i++)
            {
                webTiledLayer.displayLevels[i] = Number(webTiledLayer.displayLevels[i]); // convert to Numbers
            }
        }
        if (!isNaN(layerCreationProperties.minScale))
        {

        }
        if (layerCreationProperties.bandIds)
        {
            imgLayer.bandIds = toNumericArray(layerCreationProperties.bandIds.split(","));
        }
        if (layerCreationProperties.proxyUrl && layerCreationProperties.useProxy)
        {
