lag problem i menu.
Hej,jeg har følgende kode:
createMenuItems = function () {
//
createEmptyMovieClip("projectClip", 2);
//
top = projectClip;
// vars to hold paths
for (var i = 1; i<=PhaseText.length; i++) {
//
top.createEmptyMovieClip("baseClip"+i, i+8000);
//
m = top.attachMovie("project", "clip"+i, i+8100);
//
m.id = PhaseID[i-1];
// asign text to Phase
//
m.myText = PhaseText[i-1];
//
m.onPress = _root.pressIt;
// asign event handler to Phase
m.onRollOut = function() {
this.gotoAndPlay("rollOut");
};
//
m.onRollOver = function() {
this.gotoAndPlay("rollOver");
};
//
for (var s = 0; s<ActivitySetTexts[i-1].length; s++) {
//
top.createEmptyMovieClip('sub_baseClip'+s, s+7000);
//
l = top['sub_baseClip'+s].attachMovie("project_subMenu", "clip"+s, 7100+s);
//
//
l._y += m._height+(l._height*s);
//
l._y = Math.floor(l._y);
//
l.myText = ActivitySetText[i-1][s];
//
l.id = ActivityID[s+1];
//
l.onPress = _root.pressIt;
//
l.onRollOut = function() {
this.gotoAndPlay("rollOver");
};
//
l.onRollOver = function() {
this.gotoAndPlay("rollOut");
};
//
//
//
newTop = top['sub_baseClip'+s];
//
for (var r = 0; r<ActivityTexts[i-1].length; r++) {
//
newTop.createEmptyMovieClip('sub_sub_baseClip'+r, 6000+r);
//
o = newTop['sub_sub_baseClip'+r].attachMovie("project_subSubMenu", "clip"+r, 6100+r);
//
//
o._y += m._height+l._height+(o._height*r);
//
o.myText = ActivityText[i-1][r];
//
o.onPress = _root.pressIt;
//
o.onRollOut = function() {
this.gotoAndPlay("rollOut");
};
//
o.onRollOver = function() {
this.gotoAndPlay("rollOver");
};
//
}
//
//
//
}
//
//
//
top._y = Math.floor(top._y)+Math.floor(l._height-2);
// asign id to Phase
top = top["baseClip"+i];
//
topHolder.push(top);
// create next child
}
//
// making hide layer for last item in menu
u = top.attachMovie("projectWhite", "clip"+i, i+100);
//
u._height = 150;
//
u._y = Math.floor(top._y+m._height);
};
functionen laver 3 niveauer af lag, - det første er det øverste, det næste det miderste og så det sidste det underste.
Det virker fint til vi kommer til løkken med o.blabla
Altså med 2 niveauer, - men med o er IKKE under l niveauet...
Hvordan kan det dog være??
vh
KalleBalle
