Editing buttons in flash templates
Posted by admin in Flash, Tutorials
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.
- var menu_label:Array = new Array(“Home”, “Services|service.html”, “Testimonials”,
- “Company|http://www.flashmo.com”, “Contact”);
Second, add a few lines of codes for splitting button label and URL.
- var each_substring:String = menu_label[i].split(“|”);
- menu_item_group[“menu_item”+i].item_label = each_substring[0];
- 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.
- if( this._parent.item_url != undefined )
- getURL(this._parent.item_url, “_parent”);
- else
- _root.change_page(this._parent.item_no);
Here is the complete source codes.
- menu_item_group.menu_item._visible = false;
- var menu_label:Array = new Array(“Home”, “Services|service.html”, “Testimonials”,
- “Company|http://www.flashmo.com”, “Contact”);
- var total:Number = menu_label.length;
- var distance_x:Number = 124;
- var i:Number = 0;
- for( ; i <total; i++ )
- {
- menu_item_group.menu_item.duplicateMovieClip(“menu_item”+i, i);
- menu_item_group[“menu_item”+i].over = true;
- var each_substring:String = menu_label[i].split(“|”);
- menu_item_group[“menu_item”+i].item_label = each_substring[0];
- menu_item_group[“menu_item”+i].item_url = each_substring[1];
- menu_item_group[“menu_item”+i].item_no = i;
- menu_item_group[“menu_item”+i]._x = i * distance_x;
- }
- function change_page(no):Void
- {
- for( i = 0; i <total; i++ )
- {
- menu_item_group[“menu_item”+i].flashmo_button._visible = true;
- menu_item_group[“menu_item”+i].over = true;
- menu_item_group[“menu_item”+i].flashmo_button.onRollOver = function()
- {
- this._parent.over = false;
- }
- menu_item_group[“menu_item”+i].flashmo_button.onRollOut =
- menu_item_group[“menu_item”+i].flashmo_button.onDragOut = function()
- {
- this._parent.over = true;
- }
- menu_item_group[“menu_item”+i].flashmo_button.onRelease = function()
- {
- if( this._parent.item_url != undefined )
- getURL(this._parent.item_url, “_parent”);
- else
- _root.change_page(this._parent.item_no);
- }
- menu_item_group[“menu_item”+i].onEnterFrame = function()
- {
- if( this.over == true ) this.prevFrame();
- else this.nextFrame();
- }
- }
- delete menu_item_group[“menu_item”+no].flashmo_button.onRollOut;
- menu_item_group[“menu_item”+no].flashmo_button._visible = false;
- menu_item_group[“menu_item”+no].over = false;
- _root.page = no + 1;
- _root.play();
- }
- 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:









[...] Editing Buttons [...]
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
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.
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!!!
[...] – 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 [...]
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
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.
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.
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.
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.
Irene, I am really glad to know that you finally got it.
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.
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?
Thanks you I’m alwasy learning!
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
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.
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.
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?
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
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
hi
i download flashmo_120_artwork from flashmo
and i want to change the static text to scroll text
anybody can help me?
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
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.
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
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!
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
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
hi ggfish,
You need to select the chinese characters in character embedding as shown in the last screenshot of this post.
Not much of a help hey.
You time most be to precious to anwser some simple questions here.
Can anybody tell me, how can one add drop down menu to the present menu in the templates.
First thank you for the absolutely stunning free templates. Second, I was hoping to turn these into external links, I guess you would say open in a new window instead of have to use the page back button.
// To make a link to an external page, write label as “Label|URL” in array value
// EXAMPLE 1: “Flash Templates|http://www.flashmo.com/store”
// EXAMPLE 2: “Donate|http://www.flashmo.com/donate”
var menu_label:Array = new Array(“WELCOME”, “PRODUCTS”, “SERVICES”, “LATEST NEWS”,
“OUR CLIENTS”, “PHOTO GALLERY”, “TESTIMONIALS”, “AWARDS”,
“TEMPLATE STORE|http://www.flashmo.com/store”, “DONATE|http://www.flashmo.com/donate”,
“COMPANY”, “CONTACT” );
I saw Irene’s post and put the blank as the target, so I have my pop up link. To be a pain in the butt, how can I or can I enter in vars that will open the window to certain height and width
Hi mate
First thank you for offering those superb flash wenbsites
Iàm using at the moment flashmo_104_circular and I want to made this site to an intro ,but I cant link the the sites in the new array
var menu_label:Array = new Array(“Introduction|http://test1.html”, “Templates”, “Services”, “Clients”)the link to internal sites work perfekt but the hyperlink wont work
So thank you for help and best regards
Sorry Again
If I place the script above inside I will get a mistake in line 9 unexpecetd <
and links do not work