{FMX} One function for multiple buttons?

Hiya,

I am building an interactive world map, and for ease of updating am slapping all the functions in a frame on the main timeline.

Say I have a the word “Belgium” with a generic button symbol underneith it (instance name of Belgium of course), and also the maps shape of Belgium, as a button labeled, say Belgium_Map , each requiring several functions for rollovers, movement etc, is it possible to simple write one expresion and apply it to both buttons?

Im sure, like most things that one gets stumped on, it is pretty simple, however Im not sure of the syntax…

My code looks something like this:

buttons.belgium.onPress = function(){
map:scale_target = “250”;
map:x_target = “-1050”;
map:y_target = “-280”;
locations:x_target = “-250”;
country=“Belgium”
toptextfade.gotoAndPlay(“fadein”);
};

So can I apply it to my completly separate button with the path map.europe.belgium as well, without having to write out all that crap again for each, when they execute the same things?

Please help, as it will my make my thousands of pages worth of code a bit tidier!

Ill post it as open source once Ive finished aswell, as its pretty cool.

Cheers