Viriato
11-02-2004, 09:22 PM
Hi everyone
I have this array menu wich is loaded from external txt.
the big problem is that I need to put a large number of items, and I have not enough space in the movie to do so. :(
So I think that the best way to do so is by using an scroller effect(rollover, release, doesnt matter)
I've tried a lot of methods, scrollPane, never worked out, even the mask seems to have no effect.
the menu is composed by:
_root.menu.menuItemBase.(labelName+menuButton)
labelName - dynamic text field
menuItemBase - menuButton
I'm newbie in actionscripting. Any help is very welcome
Here's the code I use in the frame:
submenu = "WEBDESIGN";
i = 0;
test1 = new LoadVars();
test1.load("data/menu1.fst");
test1.onLoad = function(success) {
if (success) {
sectionNames = this.nome.split("|");
sectionImages = this.imagem.split("|");
sectionInfo = this.infos.split("|");
sectionCount = sectionNames.length;
sectionCount2 = sectionNames.length-1;
menuItemSpacing = 1;
for (i=1; i<=sectionCount; i++) {
_root.menu.menuItemBase.duplicateMovieClip("menuItem_"+i, i);
_root.menu["menuItem_"+i].labelName = sectionNames[i-1];
_root.menu["menuItem_"+i].labelImage = sectionImages[i-1];
_root.menu["menuItem_"+i].labelInfo = sectionInfo[i-1];
_root.menu.menuItem_1.gotoAndStop("end");
loadMovie("imgs/"+sectionImages[0], _root.img);
_root.infos = sectionInfo[0];
if (i != 1) {
_root.menu["menuItem_"+i]._y = _root.menu["menuItem_"+(i-1)]._y+_root.menu["menuItem_"+(i-1)]._height+menuItemSpacing;
}
}
}
};
_root.menu.menuItemBase._visible = false;
function checkButtons() {
for (i=1; i<=_root.sectionCount; i++) {
currentItem = "menuItem_"+i;
if (currentItem != _root.activeItem) {
_root.menu["menuItem_"+i].gotoAndStop(1);
}
}
}
next_btn.onRelease = function() {
i++;
if (i>sectionCount2) {
i = 0;
}
loadMovie("imgs/"+sectionImages[i], _root.img);
_root.infos = sectionInfo[i];
_root.menu["menuItem_"+i].gotoAndStop(1);
trace(i);
};
prev_btn.onRelease = function() {
i--;
if (i<0) {
i = sectionCount2;
}
loadMovie("imgs/"+sectionImages[i], _root.img);
_root.infos = sectionInfo[i];
trace(i);
};
I'm using MX2004 but FLA saved as MX
Thank's in advance. :)
I have this array menu wich is loaded from external txt.
the big problem is that I need to put a large number of items, and I have not enough space in the movie to do so. :(
So I think that the best way to do so is by using an scroller effect(rollover, release, doesnt matter)
I've tried a lot of methods, scrollPane, never worked out, even the mask seems to have no effect.
the menu is composed by:
_root.menu.menuItemBase.(labelName+menuButton)
labelName - dynamic text field
menuItemBase - menuButton
I'm newbie in actionscripting. Any help is very welcome
Here's the code I use in the frame:
submenu = "WEBDESIGN";
i = 0;
test1 = new LoadVars();
test1.load("data/menu1.fst");
test1.onLoad = function(success) {
if (success) {
sectionNames = this.nome.split("|");
sectionImages = this.imagem.split("|");
sectionInfo = this.infos.split("|");
sectionCount = sectionNames.length;
sectionCount2 = sectionNames.length-1;
menuItemSpacing = 1;
for (i=1; i<=sectionCount; i++) {
_root.menu.menuItemBase.duplicateMovieClip("menuItem_"+i, i);
_root.menu["menuItem_"+i].labelName = sectionNames[i-1];
_root.menu["menuItem_"+i].labelImage = sectionImages[i-1];
_root.menu["menuItem_"+i].labelInfo = sectionInfo[i-1];
_root.menu.menuItem_1.gotoAndStop("end");
loadMovie("imgs/"+sectionImages[0], _root.img);
_root.infos = sectionInfo[0];
if (i != 1) {
_root.menu["menuItem_"+i]._y = _root.menu["menuItem_"+(i-1)]._y+_root.menu["menuItem_"+(i-1)]._height+menuItemSpacing;
}
}
}
};
_root.menu.menuItemBase._visible = false;
function checkButtons() {
for (i=1; i<=_root.sectionCount; i++) {
currentItem = "menuItem_"+i;
if (currentItem != _root.activeItem) {
_root.menu["menuItem_"+i].gotoAndStop(1);
}
}
}
next_btn.onRelease = function() {
i++;
if (i>sectionCount2) {
i = 0;
}
loadMovie("imgs/"+sectionImages[i], _root.img);
_root.infos = sectionInfo[i];
_root.menu["menuItem_"+i].gotoAndStop(1);
trace(i);
};
prev_btn.onRelease = function() {
i--;
if (i<0) {
i = sectionCount2;
}
loadMovie("imgs/"+sectionImages[i], _root.img);
_root.infos = sectionInfo[i];
trace(i);
};
I'm using MX2004 but FLA saved as MX
Thank's in advance. :)