Comunidad de diseño web y desarrollo en internet online

PROBLEMA CON MENU

Citar            
MensajeEscrito el 24 Sep 2008 04:56 pm
:shock:
buenas tardes a todos, tengo el siguiente problema: descargue un menu y me anda barbaro.
Mi problema esta en que solo le puedo hacer vinculos a los subitems y no se hacer el vinculo a los botones principales. :(

les dejo el link si me pueden ayudar estaria muy agradecida.

link: http://www.actionscript.org/resources/articles/8/1/Dynamic-menu-with-submenus/Page1.html

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 24 Sep 2008 05:11 pm

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 24 Sep 2008 07:04 pm
los links de los subitems lso puedo relacionar asi:

stext26 = "Contacto";
urls26 = "contacto.html";

mi problema es lo subitems de este menu en particular no logro entender el codigo bien,

en el boton del sub menu tengo esto:

on (release) {
myURL = eval("_root.urls"+choice);
if(myURL != null){
getURL(myURL);
}
}

probe colocarlo el codigo e intente relacionar con los botones comun pero no puedo,

tu me podrias ayudar??

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 24 Sep 2008 07:12 pm
en el boton del sub menu tengo esto


¿Y en el botón del menú?

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 24 Sep 2008 07:43 pm
en las accciones tengo:

//initialize main menu
for (i=1; i<=_root.total; ++i) {
//duplicate movie clip
menuMC.duplicateMovieClip("menuMC"+i, i);
//set new position
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
this["menuMC"+i].choice = i;
//create a variable to record the levels of the created MCs
levelTrack = i;
}
//initialize submenu by creating and positioning movie clips
for (i=1; i<=_root.total; ++i) {
//check to see if the item has a submenu
if (_root["subText"+i]>=1) {
name = "stext"+i;
for (n=1; n<=_root["subText"+i]; ++n) {
levelTrack += 1;
subMenuMC.duplicateMovieClip(name+n, levelTrack);
this[name+n]._visible = false;
this[name+n].choice = (i*10) + n;
}
//position first submenu item under parent
this[name+1]._y = this["menuMC"+i]._y+this["menuMC"+i]._height;
//position rest of submenu items
for (n=2; n<=_root["subText"+i]; ++n) {
this[name+n]._y = this[name+(n-1)]._y+this[name+(n-1)]._height;
}
}
}

//hide all the submenu items and return the main menu items to their start position
function resetMenu() {
for (i=1; i<=_root.total; ++i) {
if (_root["subText"+i]>=1) {
name = "stext"+i;
for (n=1; n<=_root["subText"+i]; ++n) {
this[name+n]._visible = false;
}
}
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
}
}
// called by clicking themain menu buttons, this shows the submenu andmoves the main menu buttons to give them space
function submenuShow() {
resetMenu();
if (_root["subText"+choice]>=1) {
name = "stext"+choice;
for (n=1; n<=_root["subText"+choice]; ++n) {
this[name+n]._visible = true;
}
this["menuMC"+(choice+1)]._y = this[name+(n-1)]._y+this[name+(n-1)]._height;
for (i=choice+2; i<=_root.total; ++i) {
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
}
}
}


en el sub item:

on (release) {
myURL = eval("_root.urls"+choice);
if(myURL != null){
getURL(myURL);
}
}

y en la capa menu item. no tengo nada.

lo que pude entender es que el codigo esta relacionado solo al sub item, puede ser asi?

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 24 Sep 2008 07:48 pm

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 24 Sep 2008 08:32 pm
en las accciones tengo:

//initialize main menu
for (i=1; i<=_root.total; ++i) {
//duplicate movie clip
menuMC.duplicateMovieClip("menuMC"+i, i);
//set new position
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
this["menuMC"+i].choice = i;
//create a variable to record the levels of the created MCs
levelTrack = i;
}
//initialize submenu by creating and positioning movie clips
for (i=1; i<=_root.total; ++i) {
//check to see if the item has a submenu
if (_root["subText"+i]>=1) {
name = "stext"+i;
for (n=1; n<=_root["subText"+i]; ++n) {
levelTrack += 1;
subMenuMC.duplicateMovieClip(name+n, levelTrack);
this[name+n]._visible = false;
this[name+n].choice = (i*10) + n;
}
//position first submenu item under parent
this[name+1]._y = this["menuMC"+i]._y+this["menuMC"+i]._height;
//position rest of submenu items
for (n=2; n<=_root["subText"+i]; ++n) {
this[name+n]._y = this[name+(n-1)]._y+this[name+(n-1)]._height;
}
}
}

//hide all the submenu items and return the main menu items to their start position
function resetMenu() {
for (i=1; i<=_root.total; ++i) {
if (_root["subText"+i]>=1) {
name = "stext"+i;
for (n=1; n<=_root["subText"+i]; ++n) {
this[name+n]._visible = false;
}
}
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
}
}
// called by clicking themain menu buttons, this shows the submenu andmoves the main menu buttons to give them space
function submenuShow() {
resetMenu();
if (_root["subText"+choice]>=1) {
name = "stext"+choice;
for (n=1; n<=_root["subText"+choice]; ++n) {
this[name+n]._visible = true;
}
this["menuMC"+(choice+1)]._y = this[name+(n-1)]._y+this[name+(n-1)]._height;
for (i=choice+2; i<=_root.total; ++i) {
this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
}
}
}



en el sub item:

on (release) {
myURL = eval("_root.urls"+choice);
if(myURL != null){
getURL(myURL);
}
}


y en la capa menu item. no tengo nada.

lo que pude entender es que el codigo esta relacionado solo al sub item, puede ser asi? [/code][size=20]

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 24 Sep 2008 08:35 pm
Tu code no tiene absolutamente ninguna indentación, ahora sale igual pero con colores ... ¿no leiste el POST que puse? ¿no fui claro al explicar como darle formato?

Jorge

UPDATE: ahora puedes reemplazar el tag [ code ] por el tag [ as ]

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 24 Sep 2008 08:39 pm
la verdad no me quedo claro, pense que a esto te referias??

como le agrego el fondo amarillo?
disculpame pero no entendi

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 24 Sep 2008 08:42 pm

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 25 Sep 2008 04:48 pm
se lo que son los tags y metatags, lo que no entiendia cual tags querias el codigo,
disculpas ayer fue mucho trabajo y realmente no me di cuenta de algunas cosas del post.
saludos!



Código :

on (release) {
        myURL = eval("_root.urls"+choice);
        if(myURL != null){
                getURL(myURL);
        }
}

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 25 Sep 2008 05:48 pm
En realidad el que necesita formato es este:

Código ActionScript :

//initialize main menu
for (i=1; i<=_root.total; ++i) {
   //duplicate movie clip
   menuMC.duplicateMovieClip("menuMC"+i,i);
   //set new position
   this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
   this["menuMC"+i].choice = i;
   //create a variable to record the levels of the created MCs
   levelTrack = i;
}
//initialize submenu by creating and positioning movie clips
for (i=1; i<=_root.total; ++i) {
   //check to see if the item has a submenu
   if (_root["subText"+i]>=1) {
      name = "stext"+i;
      for (n=1; n<=_root["subText"+i]; ++n) {
         levelTrack += 1;
         subMenuMC.duplicateMovieClip(name+n,levelTrack);
         this[name+n]._visible = false;
         this[name+n].choice = (i*10)+n;
      }
      //position first submenu item under parent
      this[name+1]._y = this["menuMC"+i]._y+this["menuMC"+i]._height;
      //position rest of submenu items
      for (n=2; n<=_root["subText"+i]; ++n) {
         this[name+n]._y = this[name+(n-1)]._y+this[name+(n-1)]._height;
      }
   }
}

//hide all the submenu items and return the main menu items to their start position
function resetMenu() {
   for (i=1; i<=_root.total; ++i) {
      if (_root["subText"+i]>=1) {
         name = "stext"+i;
         for (n=1; n<=_root["subText"+i]; ++n) {
            this[name+n]._visible = false;
         }
      }
      this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
   }
}
// called by clicking themain menu buttons, this shows the submenu andmoves the main menu buttons to give them space
function submenuShow() {
   resetMenu();
   if (_root["subText"+choice]>=1) {
      name = "stext"+choice;
      for (n=1; n<=_root["subText"+choice]; ++n) {
         this[name+n]._visible = true;
      }
      this["menuMC"+(choice+1)]._y = this[name+(n-1)]._y+this[name+(n-1)]._height;
      for (i=choice+2; i<=_root.total; ++i) {
         this["menuMC"+i]._y = this["menuMC"+(i-1)]._y+this["menuMC"+(i-1)]._height;
      }
   }
}


Bien, hay un clip llamado menuMC, tiene algún code? ¿Es el que pusiste?

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 25 Sep 2008 06:06 pm
Este es el codigo dentro del Clip menu MC tengo tres capas: 1- Acciones (que es el codigo anterior) 2- subITems que trae el siguiente codigo:

Código :


on (release) {
        myURL = eval("_root.urls"+choice);
        if(myURL != null){
                getURL(myURL);
        }
}



y luego la capa 3- MenuItem que no tiene nada.


Probe agregar el codigo del SubItem al MenuItem solo que no me queda y se que si hago eso deberia modificar la capa actiones para que me funcione, pero no logro entenderlo exactamente.

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 26 Sep 2008 12:26 pm
probe agregar a la capa menu el codigo del sub menu pero tampoco funciona :shock:

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 26 Sep 2008 03:40 pm
si coloco este codico en la capa menu item

Código :

on (release) {
        myURL = eval("_root.urls"+choice);
        if(myURL != null){
                getURL(myURL);
        }
}


me deja de funcionar el menu, alguien me podria dar una ayuda???

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 26 Sep 2008 08:49 pm

Código :

on (release) {
        myURL = eval("_root.urls"+choice);
        if(myURL != null){
                getURL(myURL);
      }
            else
            {
               getURL("http://www.google.com.html");
            }
}



probe agregar un else al codigo y me camino.


ahora viendo

Dentro del clip Menu MC tengo otro clip main MenuMc con el siguiente codigo:

Código :

text = eval("_root.text" + choice);


cree un array con 10 posiciones con las direcciones y tampoco me funciono
alguiien me puede ayudar????

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 28 Sep 2008 07:28 pm
:( sig con este problema alguien me puede ayudar!!!!! :shock:

Por web_

11 de clabLevel



 

msie
Citar            
MensajeEscrito el 28 Sep 2008 07:49 pm
Mirando el menú que estás implementando, no te sería más fácil trabajar con el componente accordeón de Flash?

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox
Citar            
MensajeEscrito el 29 Sep 2008 02:11 pm
jsuto tengo este menu ya aplicado y me gustaria saber la solucion eh buscado y buscado... estoy aprendiendo mas pero no logro encontrar el problema.

Por web_

11 de clabLevel



 

msie
Citar            
MensajeEscrito el 29 Sep 2008 04:06 pm
:(

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 29 Sep 2008 05:17 pm

Código :

text = eval("_root.text" + choice);


para mi tengo qeu cambiar aca, en el maimenu, pero no me funciona tampco
:shock:

Por web_

11 de clabLevel



 

firefox
Citar            
MensajeEscrito el 30 Sep 2008 05:11 pm
nadie contesta!!!!!!! :shock:

Por web_

11 de clabLevel



 

firefox

 

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