943,779 Members | Top Members by Rank

Ad:
Sep 23rd, 2009
0

mene bar with flash

Expand Post »
h all
i have written this code from a website to make a menu bar with flash:
Graphics and Multimedia Syntax (Toggle Plain Text)
  1. var links:Array = ["www.ynet.co.il","www.walla.co.il","www.google.co.il","www.facebook.com","www.walla.com"];
  2. var menuButtons:Array = ["Home", "Works", "About", "Contact"];
  3. var subMenu1:Array = ["News", "Updates"];
  4. var subMenu2:Array = ["Web", "Print", "Interactive", "Audio", "Video"];
  5. var subMenu3:Array = ["About me", "Services", "Resume"];
  6. var subMenu4:Array = ["Email me", "City map"];
  7. var chosenMenu:Array = new Array();
  8. var subMenuOpened:Boolean = false;
  9. var whichSubMenu:Number = new Number();
  10. var currentPosition:Number = new Number();
  11. for (i=0; i<menuButtons.length; i++) {
  12. this.attachMovie("menu button", "menuButton"+i, this.getNextHighestDepth());
  13. this["menuButton"+i]._x = 30+(115*i);
  14. this["menuButton"+i]._y = 6;
  15. this["menuButton"+i].label_txt.text = menuButtons[i];
  16. this["menuButton"+i].onRollOver = function():Void {
  17. whichSubMenu = Number(this._name.substr(-1, 1));
  18. currentPosition = this._x;
  19. if (!subMenuOpened) {
  20. subMenuOpened = true;
  21. openSubMenu(whichSubMenu, currentPosition);
  22. } else {
  23. closeSubMenu();
  24. openSubMenu(whichSubMenu, currentPosition);
  25. }
  26. };
  27. }
  28. function openSubMenu(whichSubMenu, currentPosition):Void {
  29. chosenMenu = eval("subMenu"+(whichSubMenu+1));
  30. for (j=0; j<chosenMenu.length; j++) {
  31. this.createEmptyMovieClip("subMenuHolder_mc", this.getNextHighestDepth());
  32. subMenuHolder_mc.attachMovie("menu button", "subMenuButton"+j, this.getNextHighestDepth());
  33. subMenuHolder_mc["subMenuButton"+j]._x = currentPosition;
  34. subMenuHolder_mc["subMenuButton"+j]._y = 29+(j*23);
  35. subMenuHolder_mc["subMenuButton"+j].label_txt.text = chosenMenu[j];
  36. subMenuHolder_mc["subMenuButton"+j].onRelease = subMenuHolder_mc["subMenuButton"+j].onReleaseOutside=function ():Void {
  37. closeSubMenu();
  38. };
  39. }
  40. }
  41. function closeSubMenu():Void {
  42. removeMovieClip(subMenuHolder_mc);
  43. }
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-inte...rop-down-menu/
10x!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
severman is offline Offline
70 posts
since Mar 2008
Sep 23rd, 2009
0

Re: mene bar with flash

easy fix, dont use flash

there is nothing in that flash menu that can't be done smaller faster simpler in css
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009
Sep 24th, 2009
0

Re: mene bar with flash

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.
Attached Thumbnails
Click image for larger version

Name:	SolutionforLink.jpg
Views:	10
Size:	79.4 KB
ID:	11761  
Reputation Points: 167
Solved Threads: 239
Nearly a Posting Virtuoso
rajarajan07 is offline Offline
1,445 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Graphics and Multimedia Forum Timeline: Embed google maps into phpbb3
Next Thread in Graphics and Multimedia Forum Timeline: Music





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC