lyr.timeInfo is NULLBecause layer is not loaded yet.1 - Add layer to map:map.addLayer(lyr);
or dispatch Layer load event (if you do not want to add layer to your map)lyr.dispatchEvent(new LayerEvent(LayerEvent.LOAD, lyr));
2 - listen LayerEvent:lyr.addEventListener(LayerEvent.LOAD, onLayerLoad, false, 0, true);
lyr.addEventListener(LayerEvent.LOAD_ERROR, onLayerLoadError, false, 0, true);
protected function onLayerLoad(event:LayerEvent):void
{
//get lyr.timeInfo here
}
protected function onLayerLoadError(event:LayerEvent):void
{
//trace error
}