# Drop down menu code but hyperlink?

**URL:** https://forum.kirupa.com/t/drop-down-menu-code-but-hyperlink/167717
**Category:** Uncategorized
**Created:** [October 31, 2005, 11:36am UTC](https://forum.kirupa.com/t/drop-down-menu-code-but-hyperlink/167717 "2005-10-31T11:36:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tanvi](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@tanvi](https://forum.kirupa.com/u/tanvi)
#### Post date: [October 31, 2005, 11:36am UTC](https://forum.kirupa.com/t/drop-down-menu-code-but-hyperlink/167717/1 "2005-10-31T11:36:44Z")

</div>

Hi folks  
chk out the code below.  
everthing is superb except i dunno how do i give a hyperlink to subsections (which are submenus in drop down)

onClipEvent (load) {  
function openSubs(target) {  
for (i=0; i\<this[target].subs.length; i++) {  
subMenuCounter = 10;  
this[target][“sub”+i].button.newY = this[target][“sub”+i].button.outYpos;  
currentOpen = target;  
}  
// end of for  
}  
// End of the function  
function closeSubs(target) {  
for (i=0; i\<this[target].subs.length; i++) {  
this[target][“sub”+i].button.newY = this[target][“sub”+i].button.oYpos;  
}  
// end of for  
}  
// End of the function  
function doSubSection(target, sub) {  
\_root.currentSelection = target+" "+sub;  
closeSubs(currentOpen);  
}  
// End of the function  
mainSections = new Array(“About Us”, “Services”, “Products”, “Projects”, “Contact Us”);  
//, “Section 1”, “Section 2”);  
subSection0 = new Array(“Website Design”, “Multimedia”, “Consulting”);  
subSection1 = new Array(“Industry Solutions”, “Graphic Design”);  
//subSection2 = new Array(“zero”, “One”, “Two”, “Three”);  
subSection3 = new Array(“Branding/Identity”);  
for (i=0; i\<mainSections.length; i++) {  
attachMovie(“mainButton”, “main”+i, i+100);  
myButton = this[“main”+i];  
myButton.subs = this[“subSection”+i];  
myButton.button.value = mainSections\*;  
myButton.\_x = myButton.\_width_i;  
for (x=0; x\<myButton.subs.length; x++) {  
myButton.attachMovie(“subButton”, “sub”+x, x);  
mySub = myButton[“sub”+x];  
mySub.button.value = myButton.subs[x];  
mySub.button.outYpos = myButton.\_height+mySub.\_height_x;  
}  
// end of for  
}  
// end of for  
}  
onClipEvent (enterFrame) {  
subMenuCounter++;  
if (subMenuCounter\>30) {  
//closeSubs(currentOpen);  
subMenuCounter = 0;  
}  
// end if  
}  
onClipEvent (mouseUp) {  
if (!this.hitTest(\_root.\_xmouse, \_root.\_ymouse)) {  
//closeSubs(currentOpen);  
}  
// end if  
}
