Comunidad de diseño web y desarrollo en internet online

Duplicar menú hecho con código

Citar            
MensajeEscrito el 04 Ago 2009 06:25 pm
Hola, tengo un menú hecho con este código:

Código :

// Attaching the glow menu to the stage
var a=this.attachMovie("glowmenu","menu",10);
a._x = 54;
a._y = 45;

// Setting font settings of the menu
a.font = "dearJoe four";
a.bold=false;
a.italic=false;
a.size = 33;
a.embedFonts=true;

// Setting color and glow settings of the menu
a.overAlpha=100;
a.outAlpha=60;
a.textColor=0xFFFFFF;
a.glowColor=0xFFFFFF;
a.glowAmount=9;

// Enabling keeping the button active when clicked, having a first active button
a.clickActive = false;
a.activeColor=0xFFFFFF;

// Here is the check whether a flashvar named 'preActive' is set to a value in order to have
// a button already in active state when the menu is loaded. The first part of the if statement checks
// for a external variabel, the second part you can set manually, currently it is set to 2
if(this.preActive!=undefined){
   a.clickActive=true;
   a.preActive=this.preActive;
}else{
   //a.preActive=2;
}

// Setting menu settings
a.menuAlign="vertical";
a.vAlign="left";
a.vSpacing = 17;
a.hSpacing=5;

// Adding sounds to the menu
a.overSound="tic";
a.clickSound="";

// Setting the xml reference and starting the menu
a.xml_unique=false;
a.xmlref="menu.xml";
a.startClip();

// This is the function that is executed when a button is pressed. The variable 'ref' and 'tgt'
// in this function will be set to the values that you've used in the XML file or arrays.
// You can add the right actions simply by having an if statement checking the values
this.goRef=function(ref,tgt){
   trace("ref= "+ref);
   if(ref=="1"){
      gotoAndStop(10); 
   }
   if(ref=="2"){
      gotoAndStop(15); 
   }
   if(ref=="3"){
      gotoAndStop(20); 
   }
   if(ref=="4"){
      gotoAndStop(25); 
   }
   if(ref=="5"){
      gotoAndStop(30); 
   }
   if(ref=="6"){
      gotoAndStop(35); 
   }
   if(ref=="7"){
      gotoAndStop(40); 
   }
      if(ref=="8"){
      gotoAndStop(45); 
   }
}


El caso es que quiero tener dos, uno al lado del otro pero no sé cómo duplicarlo!!! Alguna idea? Gracias,

Roger.

Por rgplanet

61 de clabLevel



 

safari
Citar            
MensajeEscrito el 04 Ago 2009 06:32 pm
Supongo que glowmenu sera tu menú en swf, no? Pues lo duplicas, y lo llamas glowmenu2 y le pones el mismo codigo salvo que duplicando asi todo el AS

Código ActionScript :

var a=this.attachMovie("glowmenu","menu",10);
var a=this.attachMovie("glowmenu2","menu2",10); 
.....

Por Wyrm

Claber

1545 de clabLevel

15 tutoriales

 

firefox
Citar            
MensajeEscrito el 04 Ago 2009 06:58 pm
Fácil no???

Por sforero

478 de clabLevel

1 tutorial

 

social media expert world

chrome

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.