The situation > I’m loading imaged into my pic loader which currently mask under shape so that the image cropped to fit my shape. The image is loaded via the movie clip loader class from a path inputed from an array of stings with the path to to image. The image load into the mask pic loader masked/cropped by a shape which is inside another movie clip which has buttons inside of it. This movie clip pops up when i click and image or when i click and image and then input a password.
The problem > is that all of this works fine until I unload this swf and load another swf then return back to the original swf. Then when i try to load and image or click any button that is inside of my move clip with the pic loader they don’t function any more. I wold assume this is a problem of simple not scoping out thing correctly but traces reveal that doesn’t seem to be the case. Note this only happens when I unload the swf, load another one, unload that one and then reload the swf i started from otherwise it works fine.
Now for my code - I believe I included everything applying to my question.
for (a=1; a<8; a++) {
this['dlbtn'+a].id = a;
this['dlbtn'+a].onRelease = function() {
dlbnum = this._name.charAt(5);
trace(this);
if (dlbnum>2) {
bigdisplayctrl(true);
rollOutBtn(this);
fader.alphaTo(60,.5);
entrcode();
} else {
if (this.id == 1) {
fader.alphaTo(60,.5);
getBigDisplay(1);
rollOutBtn(dlbtn1);
//bigdisplay._x = this._x;
bigdisplayctrl(false);
trace("dlbnnum"+dlbnum);
} else if (this.id == 2) {
getRecipeCardDisplay();
}
/*//--------DOWNLOAD BUTTONS------------------
dlbtn1.onRelease = function() {
fader.alphaTo(60,.5);
getBigDisplay(1);
rollOutBtn(dlbtn1);
//bigdisplay._x = this._x;
bigdisplayctrl(false);
trace("dlbnnum"+dlbnum);
};
//trace(a)
};
this['dlbtn'+a].onRollOver = function() {
rollOverBtn(this);
};
this['dlbtn'+a].onRollOut = function() {
rollOutBtn(this);
};
}
bigdisplay._xscale = 0;
bigdisplay._yscale = 0;
fader._alpha = 0;
var downloads:Array = new Array('cornwall.gif', null, '2.jpg', '3.jpg', '4.jpg',
'5.jpg', '6.gif');
bigdisplay.closebtn.onRelease = function() {
tracebox_txt.text = "bigdisplayclosebtn";
closeDisplay();
};
function getDownloadPreview(downloadID) {
tracebox_txt.text = "getDownloadPreview";
trace('downloadID: '+downloadID);
if (downloadID != 2) {
dlpath = 'downloadimg/'+downloads[downloadID-1];
trace(dlpath);
//var container:MovieClip
var container:MovieClip = bigdisplay.picloader;
bigdisplay.createEmptyMovieClip("container",0);
//pictest_mc
//
//bigdisplay.picloader;
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip(dlpath,container);
//bigdisplay.picloader.loadMovie(dlpath);
getCorrectDepths(bigdisplay);
bigdisplay.scaleTo(100,1);
tracebox_txt.text = "getDownloadPreview 2 "+dlpath;
}
}
function onLoadInit(mc:MovieClip) {
trace("onLoadInit: "+mc);
tracebox_txt.text = "onLoadInit: "+mc;
}
function onLoadError(mc:MovieClip) {
trace("onLoadError: "+mc);
tracebox_txt.text = "onLoadErro: "+mc;
}
function onLoadComplete(mc:MovieClip) {
trace("onLoadComplete: "+mc);
tracebox_txt.text = "onLoadComplete: "+mc;
}
function getBigDisplay(id:Number):Void {
tracebox_txt.text = "getBigDisplay";
disableAllBtns();
getDownloadPreview(id);
trace("dloads"+downloadID-1);
bigdisplay.swapDepths(0);
trace('display id: '+id);
if (id == 0) {
//donothing
} else if (id == 1) {
} else if (id == 2) {
} else if (id == 3) {
bigdisplay.dlbtn.onRelease = function() {
getURL(canonpath+"downloads/coloringpage.pdf", "_blank");
closeDisplay();
};
} else if (id == 4) {
bigdisplay.dlbtn.onRelease = function() {
getURL(canonpath+"downloads/doorhanger.pdf", "_blank");
closeDisplay();
};
} else if (id == 5) {
bigdisplay.dlbtn.onRelease = function() {
getURL(canonpath+"downloads/wordsearch.pdf", "_blank");
closeDisplay();
};
} else if (id == 6) {
bigdisplay.dlbtn.onRelease = function() {
getURL(canonpath+"downloads/postcard.pdf", "_blank");
closeDisplay();
};
} else if (id == 7) {
bigdisplay.dlbtn.onRelease = function() {
getURL(canonpath+"downloads/screensaver.zip", "_blank");
closeDisplay();
};
}
}
function closeDisplay() {
fader.alphaTo(0,.5);
this._parent.bigdisplay.scaleTo(0,1);
bigdisplay.scaleTo(0,1);
enableAllBtns();
}