Complete event

Hi.

I am struggling a little with calling a function on the COMPLETE event. Here is the code:

var myLoader:Loader=new Loader()

var strURL:String=<image url>
myLoader.load(new URLRequest(strURL));
myLoader.addEventListener(Event.COMPLETE, myFunction);

this.addChild(myLoader)
myLoader.x=0
myLoader.y=0

function myFunction(evt:Event){
    trace("Load");
}

The image appears on the stage when loaded, but the function myFunction is not called. If anybody could help me with this, I would be very thankful :slight_smile: