0

h all
i have written this code from a website to make a menu bar with flash:

var links:Array = ["www.ynet.co.il","www.walla.co.il","www.google.co.il","www.facebook.com","www.walla.com"];
var menuButtons:Array = ["Home", "Works", "About", "Contact"];
var subMenu1:Array = ["News", "Updates"];
var subMenu2:Array = ["Web", "Print", "Interactive", "Audio", "Video"];
var subMenu3:Array = ["About me", "Services", "Resume"];
var subMenu4:Array = ["Email me", "City map"];
var chosenMenu:Array = new Array();
var subMenuOpened:Boolean = false;
var whichSubMenu:Number = new Number();
var currentPosition:Number = new Number();
for (i=0; i<menuButtons.length; i++) {
this.attachMovie("menu button", "menuButton"+i, this.getNextHighestDepth());
this["menuButton"+i]._x = 30+(115*i);
this["menuButton"+i]._y = 6;
this["menuButton"+i].label_txt.text = menuButtons[i];
this["menuButton"+i].onRollOver = function():Void {
whichSubMenu = Number(this._name.substr(-1, 1));
currentPosition = this._x;
if (!subMenuOpened) {
subMenuOpened = true;
openSubMenu(whichSubMenu, currentPosition);
} else {
closeSubMenu();
openSubMenu(whichSubMenu, currentPosition);
}
};
}
function openSubMenu(whichSubMenu, currentPosition):Void {
chosenMenu = eval("subMenu"+(whichSubMenu+1));
for (j=0; j<chosenMenu.length; j++) {
this.createEmptyMovieClip("subMenuHolder_mc", this.getNextHighestDepth());
subMenuHolder_mc.attachMovie("menu button", "subMenuButton"+j, this.getNextHighestDepth());
subMenuHolder_mc["subMenuButton"+j]._x = currentPosition;
subMenuHolder_mc["subMenuButton"+j]._y = 29+(j*23);
subMenuHolder_mc["subMenuButton"+j].label_txt.text = chosenMenu[j];
subMenuHolder_mc["subMenuButton"+j].onRelease = subMenuHolder_mc["subMenuButton"+j].onReleaseOutside=function ():Void {
closeSubMenu();
};
}
}
function closeSubMenu():Void {
removeMovieClip(subMenuHolder_mc);
}

can any 1 help me how to add each button a link to url?
this is the url from where i coppid the code
http://flashexplained.com/menus-interfaces/actionscript-drop-down-menu/
10x!

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

easy fix, dont use flash

there is nothing in that flash menu that can't be done smaller faster simpler in css

0

Hi severman,

Please look into the attachment for the solution for the link

You have to add the code before 37 and you added only few links.
Use the J value to refer the array relevant link.

Attachments SolutionforLink.jpg 79.4 KB
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.