Code woes

I am trying to use the preloader component (components set 2) within flash mx. The code I have so far is:

The preloader has the instance pre_load_pic1.

_root.pre_load_pic1.setLoadTarget(“pic1.jpg”);

_root.pre_load_pic1.setChangeHandler(load_pic1);

_root.hit2.onPress = function() {
myInterval = setInterval(load_pic1, 100);
};

function load_pic1() {
if (pre_load_pic1.getPercentComplete()>=99) {
loadMovie(“pic1.jpg”, _root.holder);
clearInterval(myInterval);
}
}

Unfortunately the preload bar does nowt even though the jpeg does load into the browser.

Can anyone help out?

what is getPercentComplete() ?? I don’t think there is such syntax :-\

setChangeHandler takes a string as a parameter. Try

_root.pre_load_pic1.setChangeHandler("load_pic1");

pom :slight_smile:

*Originally posted by blah-de-blah *
**what is getPercentComplete() ?? I don’t think there is such syntax :-\ **
It’s probably a member function of that particular loader class :slight_smile: