[FONT=Courier New]Hey
I’ve had help with this code in order for me to have reached this point. However the problem i’m having is that the objects in arrSub are not staying at 100% they are appearing when the button is pressed then on release they go again!
Any idea why?
arrName = ["awards.swf","charity.swf","publications.swf"]//the arrays for the sub menu
arrSub = [_root.main_cntr.PAGE.SUB.awards_MC, _root.main_cntr.PAGE.SUB.charity_MC,
_root.main_cntr.PAGE.SUB.pub_MC];
btnArray = [_root.main_cntr.btns_mc.awards_btn, _root.main_cntr.btns_mc.charity_btn,
_root.main_cntr.btns_mc.publications_btn];
for (var i = 0; i<btnArray.length; i++) {
btnArray*.ivar = i;
btnArray*.onPress = mypress;
}
function mypress(refName) {
_root.sub_cntr._alpha = 0;
_root.main_cntr.main_txt._alpha = 0;
_root.sub_cntr.main_txt._alpha = 0
_root.main_cntr.PAGE.SUB.group_picMC._alpha = 0;
_root.main_cntr.PAGE.SUB.sub_txt._alpha = 0;
_root.sub_cntr.sub_txt._alpha = 0;
_root.main_cntr.btns_mc._alpha = 100;
_root.sub_cntr.alphaTo(100,1,"easeOutCubic");
for (var obj in arrSub) {
arrSub[obj]._alpha = 0;
}
arrSub[this.ivar]._alpha = 100;
_root.sub_cntr.loadMovie(refName);
trace(arrName[this.ivar]);
}
_root.main_cntr.btns_mc.awards_btn.onRelease = function () {
mypress(arrName[0], arrSub[0], btnArray[0] )}//calls the function to load the relevant array
_root.sub_cntr.unloadMovie("charity.swf", "publications.swf")//unloads the possible 2 other swf's already in sub_cntr
_root.main_cntr.PAGE.SUB.group_picMC.alphaTo(0,1,"easeOutCubic")
[/FONT]