# MovieClipLoader do not call its methods on the correct time

**URL:** https://forum.kirupa.com/t/moviecliploader-do-not-call-its-methods-on-the-correct-time/254991
**Category:** flash
**Created:** [March 18, 2008, 1:46am UTC](https://forum.kirupa.com/t/moviecliploader-do-not-call-its-methods-on-the-correct-time/254991 "2008-03-18T01:46:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pedro\_paulo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pedro_paulo/32/2017_2.png) [@pedro\_paulo](https://forum.kirupa.com/u/pedro_paulo)
#### Post date: [March 18, 2008, 1:46am UTC](https://forum.kirupa.com/t/moviecliploader-do-not-call-its-methods-on-the-correct-time/254991/1 "2008-03-18T01:46:31Z")

</div>

hi, guys!

I´m developing an application in Flash CS3, with AS 2.0.  
I’ve been always using a custom class, wich extends MovieClipLoader and that have always worked well. But today it did not.

What is happening: the MovieClipLoader instance does not call “onLoadProgress” until all the file has been dowloaded. So, my preloader does not show any number. Just: “0%” and “100%”. But, this is the strange part: AFTER the jpg is downloaded, flash shows, at the same time, all the onLoadProgress´s tasks as the onLoadComplete tasks.

Thinking about all the classes the projetc has, I did a very simple flash, with a very simple code, like the “flash help” says:  
On Stage, _target_ is a MovieClip and _pct\_txt_ is a dynamic TextField.

```auto

var mcl:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();

listener.onLoadProgress = function(target_mc:MovieClip, bl:Number, bt:Number):Void {
    var pct:Number = Math.round((bl/bt) * 100);
    pct_txt.text = "loading..." + pct;
    trace("pct: " + pct);
}
listener.onLoadStart = function(target_mc:MovieClip):Void {
    pct_txt.text = "start";
}
listener.onLoadComplete = function(target_mc:MovieClip):Void {
    pct_txt.text = "end";
}
mcl.addListener(listener);
mcl.loadClip("http://www.ppwebart.com/projetos/fontenews/admin/uploads/fichas/10.jpg", target);

```

So, the sequence is:

1. I call the line mcl.loadClip(“[http://etc](http://etc)”, target)
2. After 10 seconds, **all at the same time** : the image is showed, the percentage list of number is showed at the Output panel and the pct\_txt.text shows the “end” word. :stare:😟

Well. Does anybody know why the “onLoadProgress” is not called **during** the process and not after all the process get finished ?  
You can see this code in action at:

[http://www.ppwebart.com/teste/testemcl.html](http://www.ppwebart.com/teste/testemcl.html)  
And the fla file at  
[http://www.ppwebart.com/teste/testemcl.fla](http://www.ppwebart.com/teste/testemcl.fla)

Thanks a lot!  
Pedro Paulo Almeida

PS: the “getProgress()” method returns “undefined”. I have cleared the browser´s cache.
