I’m trying to take full advantage of the movieClipLoader along with listeners. But my callbacks aren’t getting triggered. Inside one function I loadClip, when onLoadComplete happens I set the onRelease function. Within that onRelease I call another function (“cdPress”) that also loads bigger images inside a clip.
None of the callbacks in the cdPress function are working. The function is being called successfully, but the “onWhatever” callbacks are not. What am I doing wrong?
function someFunction(){
cdListener.onLoadComplete = function(target_mc) {
target_mc.onRelease = function() {
depth = this.getDepth();
// Call the cdPress function here -------------------
cdPress(this, _root.currentArtist.cdImg[depth], true);
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(cdListener);
image_mcl.loadClip(_root.currentArtist.cdImgTn[m], _root.artist_mc.discScroll["cdBtnImg"+m]);
}
function cdPress(x, theImage, isCD) {
bigImgListener.onLoadInit = function(target_mc){
_root.discDetail_mc.preLoader_mc._visible = true;
_root.discDetail_mc.preLoader_mc.loadBar_mc._width = 0;
_root.discDetail_mc.preLoader_txt.text = "onLoadInit called";
}
bigImgListener.onLoadStart = function(target_mc){
var loadprogress = bigImg_mcl.getProgress(target_mc);
_root.discDetail_mc.preLoader_txt.text = "onLoadStart called";
}
bigImgListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes){
_root.discDetail_mc.preLoader_mc.loadBar_mc._width = (loadedBytes/totalBytes)*100;
_root.discDetail_mc.preLoader_txt.text = "loadedBytes = "+loadedBytes;
}
bigImgListener.onLoadComplete = function(target_mc){
_root.discDetail_mc.preLoader_mc._visible = false;
//trace("complete with "+loadedBytes+" bytes loaded");
_root.discDetail_mc.preLoader_txt.text = "complete";
}
depth = x.getDepth();
_root.discDetail_mc._visible = true;
if (isCD == true) {
_root.discDetail_mc.cdTitle_txt.text = _root.currentArtist.cdTitle[depth];
} else {
_root.discDetail_mc.cdTitle_txt.text = _root.currentArtist.name_text;
}
bigImg_mcl = new MovieClipLoader();
bigImg_mcl.addListener(bigImgListener);
bigImg_mcl.loadClip(theImage, _root.discDetail_mc.cdBig_mc);
}