Buon giorno

sto cercando di far visualizzare una ProgressBar per il caricamento di un file XML ma non riesco a capire perchè mi da errore

Codice PHP:
import fl.controls.ProgressBar;
import fl.controls.Label

var dataPath:String "http://localhost/XML/mio.xml";
var 
loader:URLLoader = new URLLoader();
loader.load(new URLRequest(dataPath));

var 
progressReport:Label = new Label();
progressReport.move(10,30);
progressReport.autoSize TextFieldAutoSize.LEFT;
addChild(progressReport);

var 
pb:ProgressBar = new ProgressBar();
pb.move(10,10);
pb.source loader;
pb.addEventListener(ProgressEvent.PROGRESS,updateProgressReport);
addChild(pb);

function 
updateProgressReport(e:ProgressEvent):void {
    
progressReport.text Math.round(pb.percentComplete) + "% Loaded";

ERRORI:

TypeError: Error #2007: Il valore del parametro child deve essere diverso da null.
at flash.display:isplayObjectContainer/addChildAt()
at fl.controls::ProgressBar/fl.controls:ProgressBar::drawTrack()
at fl.controls::ProgressBar/fl.controls:ProgressBar::draw()
at fl.core::UIComponent/::callLaterDispatcher()

Grzie