         }
         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
-            }
+            webTiledLayer.displayLevels = toNumericArray(layerCreationProperties.displayLevels.split(","));
         }
         if (!isNaN(layerCreationProperties.minScale))
         {

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

    private static function createDynamicLayer(layerCreationProperties:LayerCreationProperties):ArcGISDynamicMapServiceLayer

        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)
        {
