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

        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;
        }
        if (layerCreationProperties.autoRefresh > 0)
        {

            tiledLayer.maxScale = layerCreationProperties.maxScale;
        }
        return tiledLayer;
    }

    private static function toNumericArray(textualNumberArray:Array):Array
    {
        var numericArray:Array = [];
        for (var i:int = 0; i < textualNumberArray.length; i++)
        {
            numericArray.push(Number(textualNumberArray[i]));
        }
        return numericArray;
    }

    private static function createDynamicLayer(layerCreationProperties:LayerCreationProperties):ArcGISDynamicMapServiceLayer
