Need help, have a bug with image loader

have a big problem with one site that have just finished.
i’m not a master in action scripting, i used a simple image loader class with action script 2 with preloader, it works well, preloads and loads the image perfectly.
the problem is that after a while (maybe 1 mn) the image disappers.

here is the code i used:

[COLOR=Red]bar2._visible = false;
per2._visible = false;

this.createEmptyMovieClip(“container2”, “100”);
my_mc2= new MovieClipLoader();
preload2 = new Object();
my_mc2.addListener(preload2);
preload2.onLoadStart = function(targetMC2) {

//trace("started loading "+targetMC);
container2._visible = false;
bar2._visible = true;
per2._visible = true;
pText2._visible = true;

};
preload2.onLoadProgress = function(targetMC2, l2Bytes, t2Bytes) {

bar2._width = (l2Bytes/t2Bytes)*100;
per2.text= "Loading: % "+Math.round((l2Bytes/t2Bytes)*100);

};
preload2.onLoadComplete = function(targetMC2) {

targetMC2._visible = true;
targetMC2._alpha = 0;
targetMC2.onEnterFrame= function(){targetMC2._alpha+=10};
per2._visible = false;
bar2._visible = false;
pText2._visible = false;
//trace(targetMC+" finished");

};
my_mc2.loadClip(“img/01.jpg”, “ima”);

//default image
b1.onPress=function(){my_mc2.loadClip(“img/01.jpg”, “ima”);}
b2.onPress=function(){my_mc2.loadClip(“img/02.jpg”, “ima”);}
b3.onRelease=function(){my_mc2.loadClip(“img/03.jpg”, “ima”);}
b4.onRelease=function(){my_mc2.loadClip(“img/04.jpg”, “ima”);}
b5.onRelease=function(){my_mc2.loadClip(“img/05.jpg”, “ima”);}
b6.onRelease=function(){my_mc2.loadClip(“img/06.jpg”, “ima”);}

[COLOR=Black]please can someone help me!!:pa:[/COLOR]
[/COLOR]

targetMC2.onEnterFrame= function(){targetMC2._alpha+=10

that doesn’t seem healthy you should tween from 0 to 100, not enterframe with no delete command

there aint that much code… I doubt what is wrong is within what is above

thank you for replying.
“ima” is the movieclip where the images are loaded.
the loading works well, but the real problem is that the image disappears after a while (1 mn).

thank you randomagain

i will try this even if i ever used the function “tween” before.
its time to begin.

http://www.kirupa.com/developer/actionscript/tween.htm

I was dubious at first, but it is so much easier,

I can only suggest there is a set interval, delete, unload, alpha, _visible

somewhere in your code which is wiping out the images

Btw this is your problem in your code
targetMC2._alpha+=10

Your alpha value is exceeding 100 and keeps incrementing 10 even though unnecessary.
When it exceeds 900 or so your movieclip will dissappear. Add a condition for 100 or use tweens as randomagain has mentioned.

Hope that solves your predicament.

thank you for helping me,
i will try this and inform you about the results.

thanks to excogitator i found the metter with my code.
i added the condition for 100 and it solves the problem.

thanks to everybody, for your help.

I said that :stuck_out_tongue_winking_eye: