Some days ago, i got a pretty interesting e-mail from a fellow designer from Hong Kong. He asked me if there was the possibility of adding a rollOver action to the menu.
I remembered that I had this working in a previous version of the portfolio, but for some reason I somehow deleted this option or action. Well I took the time to Update this and make it work again without changing much of the code.
I have added the code, i hope it works.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
| renderItems = function (id, totalsubLinks, newposCont, fatherID) {
if (BsubLinks.length>0) {
cleansubLinks(BsubLinks);
}
BsubLinks = new Array();
for (n=totalsubLinks-1; n>=0; n--) {
initCont = mc_menu.holder.mc_cont.attachMovie("mc_contbutt", "sb", this.getNextHighestDepth());
var newCont = initCont.duplicateMovieClip("sb"+n, 1+n);
BsubLinks[n] = newCont;
newCont.label = "- "+mainContent[id][n]["title"];
newCont.trackinglabel = mainContent[id][n]["title"];
newCont.txtCaption = mainContent[id][n]["caption"];
newCont.newID = mainContent[id][n]["id"];
newCont.fatherID = fatherID;
newCont.childID = n;
newCont.pressed = false;
newCont.totalTabs = mainContent[id][n][0].length;
newCont._y = newposCont;
newposCont = newCont._y+newCont._height;
newCont.onRelease = function() {
doTabs(this.totalTabs,this.fatherID,this.childID);
showCaption(this.txtCaption);
mc_caption._alpha = 100;
mc_main._alpha = 100;
mc_shadow._alpha = 100;
turnofSublinks(BsubLinks);
this.gotoAndStop(2);
this.pressed = true;
};
newCont.onRollOver = function() {
this.gotoAndStop(3);
};
newCont.onRollOut = newCont.onReleaseOutside=function () {
if (this.pressed == true) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
};
}
initCont.removeMovieClip(sb);
};
function turnofSublinks(buttonsArr) {
var totalB = buttonsArr.length;
for (n=0; n<totalB; n++) {
buttonsArr[n].pressed = false;
buttonsArr[n].gotoAndStop(1);
}
} |