Lost help moi

Having problems with loading dynamic jpg´s with preloader.

When loading the first pic with button1 the preloader is working fine. But if I click button2 to load another image my preloader bar doesnt move at all (stays at 299 pixels). Im using this code:


this.createEmptyMovieClip("preloader", 1000);
this.createEmptyMovieClip("container", 1001);
container._x = 5 ;
container._y = 28 ;
container._visible = false;
preloader.onEnterFrame = function() {
    var l = container.getBytesLoaded();
    var t = container.getBytesTotal();
    var getPercent = l/t;
    //loadText = Math.round(getPercent*100)+"%";
    loadBar._width = getPercent*299;
    if (l>0 && l>=t) {
        container._visible = 1;
        delete this.onEnterFrame;
    }
};

button1.onPress = function() {
    container.loadMovie("image1.jpg");
};

button2.onPress = function() {
    container.loadMovie("image2.jpg");
};

Whats wrong ??

the “delete this.onEnterFrame” stops the preloader from working. You either need to re-initialize it, or take out that part of the code. Try to remove the delete this.onEnterFrame code and it should work for you. Its really not necessary to have that there anyway… only saves a little processor speed and you aren’t doing anything too processor intensive…

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21198 :stuck_out_tongue:

Solution: What Jubba Said…

and Ahmed: This is exactly why I signed the petition…lol.

woohoo I feel smart. :slight_smile:

lol yeah :beam:… pretty smart of moock eh :stuck_out_tongue:

Jubba: You are smart

Ahmed: Well moock is always smart, but it was still a great idea of him to create this petition. Do you think he will actually send it in to macromedia as a complaint?

I hope so. Those 300-something people didn’t sign it for nothing! :bad: :stuck_out_tongue:

I’m sure Moock will. He has tremendus influence on the Flash community and I’m sure Macromedia as well. He’s one of those people that is in the position to make something happen. It would be different if I had started it. :slight_smile: