useful tips and resources

Editing buttons in flash templates

July 14th, 2008 · 28 Comments

This is a quick solution for those who wanted to assign some buttons to go to web pages or URLs in existing main menu of flashmo.com templates. Button action scripts are usually located on first frame of actions layer.

First, you need to use the separator | between button label and URL. e.g. “Services|service.html”, “Company|http://www.flashmo.com” for buttons which are pointing to other web pages.

Actionscript:
  1. var menu_label:Array = new Array(“Home”, “Services|service.html”, “Testimonials”,
  2. “Company|http://www.flashmo.com”, “Contact”);

Second, add a few lines of codes for splitting button label and URL.

Actionscript:
  1. var each_substring:String = menu_label[i].split(“|”);
  2. menu_item_group[“menu_item”+i].item_label = each_substring[0];
  3. menu_item_group[“menu_item”+i].item_url = each_substring[1];

Third, add if else statement to check the URL exists or not in button onRelease action.

Actionscript:
  1. if( this._parent.item_url != undefined )
  2. getURL(this._parent.item_url, “_parent”);
  3. else
  4. _root.change_page(this._parent.item_no);

Here is the complete source codes.

Actionscript:
  1. menu_item_group.menu_item._visible = false;
  2. var menu_label:Array = new Array(“Home”, “Services|service.html”, “Testimonials”,
  3. “Company|http://www.flashmo.com”, “Contact”);
  4. var total:Number = menu_label.length;
  5. var distance_x:Number = 124;
  6. var i:Number = 0;
  7.  
  8. for( ; i <total; i++ )
  9. {
  10. menu_item_group.menu_item.duplicateMovieClip(“menu_item”+i, i);
  11. menu_item_group[“menu_item”+i].over = true;
  12.  
  13. var each_substring:String = menu_label[i].split(“|”);
  14. menu_item_group[“menu_item”+i].item_label = each_substring[0];
  15. menu_item_group[“menu_item”+i].item_url = each_substring[1];
  16. menu_item_group[“menu_item”+i].item_no = i;
  17. menu_item_group[“menu_item”+i]._x = i * distance_x;
  18. }
  19. function change_page(no):Void
  20. {
  21. for( i = 0; i <total; i++ )
  22. {
  23. menu_item_group[“menu_item”+i].flashmo_button._visible = true;
  24. menu_item_group[“menu_item”+i].over = true;
  25. menu_item_group[“menu_item”+i].flashmo_button.onRollOver = function()
  26. {
  27. this._parent.over = false;
  28. }
  29. menu_item_group[“menu_item”+i].flashmo_button.onRollOut =
  30. menu_item_group[“menu_item”+i].flashmo_button.onDragOut = function()
  31. {
  32. this._parent.over = true;
  33. }
  34. menu_item_group[“menu_item”+i].flashmo_button.onRelease = function()
  35. {
  36. if( this._parent.item_url != undefined )
  37. getURL(this._parent.item_url, “_parent”);
  38. else
  39. _root.change_page(this._parent.item_no);
  40. }
  41. menu_item_group[“menu_item”+i].onEnterFrame = function()
  42. {
  43. if( this.over == true ) this.prevFrame();
  44. else this.nextFrame();
  45. }
  46. }
  47. delete menu_item_group[“menu_item”+no].flashmo_button.onRollOut;
  48. menu_item_group[“menu_item”+no].flashmo_button._visible = false;
  49. menu_item_group[“menu_item”+no].over = false;
  50. _root.page = no + 1;
  51. _root.play();
  52. }
  53. change_page(0); // the default page on load

Edit the timeline in menu item movie clip for rollover effect for modifying the button effect.
Edit menu item label movie clip for embedding characters in your language font. See the example below:

Embedding Font in Flash

Tags: Flash · Tutorials

28 responses so far ↓

  • 1 Editing Flash Templates // Jul 14, 2008 at 11:07 am

    […] Editing Buttons […]

  • 2 Richard // Jul 27, 2008 at 5:08 pm

    Thanks for the templates fantastic also the tips…..just 1 question i coppid the script and it worked perfect but how does it work for a vertical buttons bar ..thanks richard

  • 3 Jhay // Aug 12, 2008 at 10:17 am

    hi how can i edit the menu button on flashmo 081 design, i wanted to change the text into my own menu. For example “Our Clients” will become “Our members” PLEASE HELP.

  • 4 cangrejero // Aug 18, 2008 at 9:17 pm

    This tutorial helped me a lot and I was able to modify a vertical scroller template with little effort. My problem is that I have tried to add a button to send an email using the client’s email program, to no avail. I don’t want to use PHP for it. Could you point me in the right direction? Any help appreciated. Thanks!!!

  • 5 Bookmarks about Button // Sep 1, 2008 at 11:41 pm

    […] - bookmarked by 1 members originally found by tamberg on 2008-08-10 Editing buttons in flash templates http://www.webdesignmo.com/blog/2008/07/14/editing-buttons-in-flash-templates/ - bookmarked by 2 […]

  • 6 molped // Sep 4, 2008 at 12:35 pm

    Hello!

    Thanks for some great free templates!

    In template “104 cirkular” I tried assigning buttons to go to webpages/URL’s. I used this tutorial + your code for splitting button labels and URL’s. But I can’t get i to work.
    Where in the original template-code do I add this extra code?

    Best regards

  • 7 Chris // Sep 9, 2008 at 11:26 pm

    I was wondering on template 089 How do you change the spacing of the buttons. I changed the text and now their is a big gap between two buttons.

  • 8 admin // Sep 10, 2008 at 7:40 am

    Chris, you need to edit line 15 in first frame of actions layer.

    menu_item_group[”menu_item”+i]._x = i * 86;

    You can adjust the number 86 to lower value.

  • 9 Irene // Sep 14, 2008 at 9:18 am

    I can’t believe I found this string…I am working on exactly this and managed to manipulate it pretty good (http://www.piratesofthecapitalcity.com/pirate_flash.html) . I’m still working on it. My question is how do I add a string to open the external url on the menu with a “_blank” target.

    Thanks so much.

  • 10 Irene // Sep 14, 2008 at 10:00 am

    I found it! I should have looked at the code a little harder!
    _______________

    mi.flashmo_button.onRelease = function()
    {
    if( this._parent.item_url != undefined )
    getURL(this._parent.item_url, “_blank”); <<<<<<<

    else
    _root.change_page(this._parent.item_no);
    };

    _____________

    the original file had “parent” so I changed.

  • 11 admin // Sep 14, 2008 at 10:04 am

    Irene, I am really glad to know that you finally got it. :)

  • 12 Rix // Oct 15, 2008 at 11:54 am

    Hi,

    I am currently using template 081 and i am trying to get equal spacing between the letters of my menu.

    The space between most items is fine except between “What is Radiology” and “Practitioners”.

    Is this because more than one word is used? If so, is there a way around this?

    Also, is there a way to centre align the menu to the the page or do you just have to go by eye adjusting the x co-ordinate value?

    Code is:
    menu_item_group.menu_item._visible = false;
    var menu_label:Array = new Array(”About”, “What is Radiology”, “Practitioners”, “FAQ’s”, “Location”, “Contact”);
    var total:Number = menu_label.length;
    var distance_x:Number = 124;
    var i:Number = 0;

    Any help is appreciated.

  • 13 antony diamandopoylos // Oct 17, 2008 at 8:51 pm

    Hi to all,
    i am ussing the 079 classic template an i would like to add drop down menus on the exhisting menu.
    how is that possible through actionscript?

  • 14 the flash menu designer // Oct 23, 2008 at 3:25 pm

    Thanks you I’m alwasy learning!

  • 15 chris // Oct 31, 2008 at 7:48 am

    Hi,

    im totally new to this flash thing. i was looking at the portfolio template (135) and tried editing the menu (testimonials to about us) but cant seem to understand what im supposed to do or how to go about it…. please help

  • 16 Yan // Nov 6, 2008 at 11:20 am

    Hey,

    I’m currently trying to edit flashmo 120 artwork, and I can’t find any of these source codes. So needless to say I’m having massive difficulty changing the button menus. Everything else works great and was not hard to edit.

    Any advice? Please.

  • 17 TONY // Nov 28, 2008 at 4:11 am

    hola, necesito ayuda urgente, no se como modificar el texto de los botones de la plantilla flashmo_086_speaker,he leido bien estas instrucciones pero no las entiendo.gracias por su ayuda,son fabulosas estas plantillas, y es que acabo de empezar con el tema del flash,por cierto no se me habre el archivo de fla de flashmo_124_delicious, me dice formato de archivo inesperado.gracias por favor digame algo. estoy parado.

  • 18 Mavix // Jan 22, 2009 at 1:55 am

    Hi,
    my name is mavix I’m a beginner and I got the template 100 building where there is above a sign hung by chain that is moving when we move the mouse.
    Well, I would like to turn it in a button to navigate into my contents’ page, to come back home or another page we want like About-us, Portfolio, Contact…Whatever!
    I mean, What code should I write for it to work perfectly? I am trying the telltarget but I didn’t get along well!
    it was the code I wrote:

    on(release) {
    tellTarget(”flashmo_contents”) {
    gotoAndStop(2);
    }
    }

    Please! Could somebody help me?

  • 19 parpar // Jan 29, 2009 at 5:23 am

    Hello.
    Great job on the templates, they are really wonderful, thank you.
    I hope you could help me with a little problem.
    I am using a menu based on flashmo_128_elegant with a css template so all the links are external.
    The problem is that after I press on the button it should stay pressed down (like on the flash template itself).
    Any idea how to fix this problem?
    Thanks

  • 20 Arielle // Feb 27, 2009 at 2:43 am

    Hey!

    I am working with flashmo_142_color. I am trying to add a navigation bar to all pages so you do not have to continuall return to the main menu to go to another page? Any suggestions on how to do this- I keep messing it up!

    thank you!!

    A

  • 21 shahram // May 13, 2009 at 11:32 pm

    hi
    i download flashmo_120_artwork from flashmo
    and i want to change the static text to scroll text
    anybody can help me?

  • 22 Vasco Ferreira // Jun 10, 2009 at 6:26 am

    Hey!

    I already try to contact you by email and also by private message on twitter but i didn’t get any answer.

    I’ve been working on flashmo 117 artistic, and in the xml page of product page, the characters don’t work right.

    I already try to fix it embedding characters but it still don’t work.

    Can anyone help? I don’t want to change my template and start over

  • 23 Martin // Jun 17, 2009 at 3:47 am

    Hello there,

    i’m building a flash site using the Template 072.

    I wish to put the menu on an angle following some background graphics.

    How can i do that?

    Thanks for your precieous time.

  • 24 Kapek // Jun 22, 2009 at 5:28 am

    Hello,

    I try to edit buttons in Sunrise template but i don’t know how to do it. Can anyone help me here or send an example to my e-mail address ?? !!

    I do everything as it is in this tutorial but isn’t work ! :(

    Please help. ;) Sorry for my English.

    Patryk

  • 25 kelly1 // Jun 26, 2009 at 8:45 am

    Hi, I know nothing about flash and do not have any flash software. However, after much tinkering, I was able to get the Flashmo template 2206 to work, but I need to remove a “download” button/feature in the template. Does anyone know how to eliminate or at least disable this “download” button? It’s within the gallery, after you click on an image to enlarge it. If you know how to do it, what is the name of the file I need to work with and can I make the changes in Text Edit? Thanks!

  • 26 yaz // Jun 29, 2009 at 5:40 pm

    I love the flash temp..cool
    I try to edit the “home button” that return to the main page from flashmo_109 rectangular. but can’t find it..plss hel me..tq

  • 27 ggfish // Jun 30, 2009 at 11:28 am

    hi~thanks a lot for your flash tempalte :)
    i come from china ,
    and i wonder how can i edit the {new Array(“Home”, “Services|service.html”, “Testimonials”,
    “Company|http://www.flashmo.com”, “Contact”);} to chinese charset ,it can not display chinese charset ,would you please tell me how can i do that ?
    thanks a lot~ best wishes

  • 28 admin // Jun 30, 2009 at 11:35 am

    hi ggfish,

    You need to select the chinese characters in character embedding as shown in the last screenshot of this post.

Leave a Comment