|
-
Help linking submenu items. please.
Below is the code I am using. The submenu isn't physically on the stage it's only called in the actionscript. I have no idea how to make the "menu=Beauty, Location, Studio" link to new pages. Any ideas on how I can do this? I am clueless as to what code I would use and where I would put it. Any input would be greatly appreciated. Thank you.
menu = ["Beauty", "Location", "Studio"];
xStart = 662;
yStart = 190;
bWidth = 79;
bHeight = 17;
interval = 50;
countDown = menu.length;
menuOpen = false;
theTime = 0;
buttonScrollSpeed = 2;
for (var i = 0; i<menu.length; i++) {
var b = this.attachMovie("subButton", "subButton"+i, countDown);
countDown--;
b.stop();
b._x = xStart;
b._y = yStart;
b.interval = interval*i;
b.target = yStart+(bHeight*i);
b.txt = b.page=menu[i];
b.onPress = function() {
closeMenu();
_root.pages.gotoAndStop(this.page);
this.gotoAndStop(1);
};
b.onRollOver = function() {
this.gotoAndStop(2);
};
b.onRollOut = function() {
this.gotoAndStop(1);
};
b._visible = false;
}
function closeMenu() {
for (var i = 0; i<menu.length; i++) {
var b = this["subButton"+i];
b._visible = false;
b._x = xStart;
b._y = yStart;
}
menuOpen = false;
}
mainButton.onPress = function() {
if (!menuOpen) {
theTime = getTimer();
menuOpen = true;
for (var i = 0; i<menu.length; i++) {
_root["subButton"+i]._visible = true;
}
} else {
closeMenu();
}
};
function scrollButtons() {
if (menuOpen) {
for (var i = 0; i<menu.length; i++) {
var b = this["subButton"+i];
if ((theTime+b.interval)<getTimer()) {
b._y += (b.target-b._y)/buttonScrollSpeed;
}
}
}
}
this.onEnterFrame = function() {
scrollButtons();
};
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|