Codice PHP:
// Variables -----------------------------------------------------------------------
// Height of Mainmenu items
var homm 20;
// Height of Submenu items
var hosm 15;
// mm_array contains the main menu, sm#_array contains the sub menu items for menu #
var mm_array:Array = ["HOTEL""CENTRO BENESSERE""MEETING""RISTORANTE""SPORT IN VACANZA""CONTATTACI"];
var 
sm1_array:Array = ["camere""prezzi""gruppi""speciale bambini""speciale terza età"];
var 
sm2_array:Array = ["trattamenti""beauty farm""programmi speciali"];
var 
sm3_array:Array = ["gli spazi""organizzazione eventi""banchetti""catering""il teatro"];
var 
sm4_array:Array = ["le sale""i menu""accoglienza"];
var 
sm5_array:Array = ["animazione""il maneggio""tennis""footin""ciclismo""wind surf"];
var 
sm6_array:Array = ["richiedi informazioni""prenota""info generali"];
var 
submenu_array:Array = [];
            var 
um1_array:Array = ["http://www.google.it""http://www.yahoo.it""http://www.yahoo.it","http://www.yahoo.it"];
            var 
um2_array:Array = ["http://www.google.it""http://www.yahoo.it""http://www.yahoo.it","http://www.yahoo.it"];
            var 
um3_array:Array = ["http://www.google.it""http://www.yahoo.it""http://www.yahoo.it","http://www.yahoo.it"];
            var 
um4_array:Array = ["http://www.google.it""http://www.yahoo.it""http://www.yahoo.it","http://www.yahoo.it"];
            var 
um5_array:Array = ["http://www.google.it""http://www.yahoo.it""http://www.yahoo.it","http://www.yahoo.it"];
            var 
um6_array:Array = ["http://www.google.it""http://www.yahoo.it""http://www.yahoo.it","http://www.yahoo.it"];
// Functions ------------------------------------------------------------------------
_global.$tweenManager.broadcastEvents true;
// Main menu
function createMainMenu() {
    var 
1;
    var 
total mm_array.length;
    while (
a<=total) {
        
ypos = ((a-1)*homm)+1;
        
attachMovie("mainnav_mc""mainnav"+a+"_mc"this.getNextHighestDepth()+100, {_x:0_y:ypos});    // attach the movieClip
        
var nc this["mainnav"+a+"_mc"];
        
nc.menutext mm_array[(a-1)];    // set the title text for each button
        
nc.itemnum a;    // set the menu #
        
a++;
    }
}
function 
moveMenu(num) {
    if ((
_root.collapsed == true) || (_root.selectedmenu != num)) {
            var array = 
"sm"+num+"_array";
            var 
totalsm = eval(array).length;
            var 
totalmm mm_array.length;
            var 
1;
        while (
a<=totalmm) {
                
mc this["mainnav"+a+"_mc"];
            if (
a>num) {
                    var 
ypos = (((a-1)*homm)+1)+totalsm*(hosm+1);
                
mc.tween("_y"ypos0.5"easeOutCubic"); 
            } else {
                var 
ypos = ((a-1)*homm)+1;
                if (
== num) {
                    
nypos ypos;
                    
mc.tween("_y"ypos0.5"easeOutCubic"0onEnd(numnypos));
                } else {
                    
mc.tween("_y"ypos0.5"easeOutCubic");
                }
            }
            
a++;
        }
        
_root.collapsed false;
    } else {
        
contractMenu()
        
_root.collapsed true;
    }
}
function 
onEnd(numnypos) {
    
_root.num num;
    
createSubMenu(numnypos);
}
function 
contractMenu() {
    var 
1;
    while (
c<=submenu_array.length) {
        
removeMovieClip("subnav"+c+"_mc");
        
removeMovieClip("mask"+c+"_mc");
        
c++;
    }
    var 
1;
    while (
g<=mm_array.length) {
        
ypos = ((g-1)*homm)+1;
        
this["mainnav"+g+"_mc"].tween("_y"ypos0.5"easeOutCubic");
        
g++;
    }
}
function 
createSubMenu(numnypos) {
    var array = 
"sm"+num+"_array";
    var 
totalsm = eval(array).length;
    var 
ypos nypos+4;
    var 
1;
    while (
c<=submenu_array.length) {
        
removeMovieClip("subnav"+c+"_mc");
        
removeMovieClip("mask"+c+"_mc");
        
c++;
    }
    
submenu_array = [];
    var 
1;
    while (
a<=totalsm) {
        
ypos ypos+hosm+1;
        
attachMovie("subnav_mc""subnav"+a+"_mc"a+30, {_x:0_y:ypos});
        if (
num != mm_array.length) {
            
attachMovie("mask_mc""mask"+a+"_mc"a+990, {_x:0_y:0});
            
mask_mc this["mask"+a+"_mc"];
            
mask_mc._alpha 10;
            
mask_mc.onEnterFrame = function() {
                
this._height _parent.container_mc["mainnav"+mm_array.length+"_mc"]._y;
            };
            
this["subnav"+a+"_mc"].setMask(mask_mc);
        }
        
nc this["subnav"+a+"_mc"];
        
nc._alpha 0;
        
nc.itemnum a;
        
nc.menutext = eval(array)[(a-1)];
        
nc.alphaTo(1002);
        
nc.onRelease = function() {
            
// Function to get submenu actions needs to go here
            
var my_str:String = new String(this);
            
// inserimento fatto da me dei links - prova effettuata 13-04-2007
            
        
};
        
submenu_array.push("subnav"+a+"_mc");
        
a++;
    }
}
// Build Menu -----------------------------------------------------------------------
_root.collapsed true;
createMainMenu();