Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/07/2010, 06:48
brunoop
 
Fecha de Ingreso: junio-2010
Mensajes: 36
Antigüedad: 13 años, 11 meses
Puntos: 0
problema con los urls

Hola estoy teniendo un problema con las url de los menus y submenus.
el problema que tengo es que al apretar sobre un submenu, este me dirige a la url del ultimo submenu dentro de ese menu, y cuando apreto sobre un menu, me dirige a la url del ultimo menu. Debe de ser algun problema del codigo de actionscript, se los dejo aqui para que le hechen una ojeada:

Código ASP:
Ver original
  1. var my_xml:XML = new XML();
  2. my_xml.load("data/menus.xml");
  3. my_xml.ignoreWhite = true;
  4. var menues:Array = new Array();
  5. var _this = this;
  6. var submenu
  7. var url
  8. my_xml.onLoad = function(success) {
  9.     if (success) {
  10.         //  trace(this)
  11.         menues = this.childNodes;
  12.         for (var i = 0; i<menues.length; i++) {
  13.             //var url= menues.firstChild
  14.             _this.attachMovie("menu_mc", "menumc_"+i, -i);
  15.             _this["menumc_"+i].menutxt.text = menues[i].attributes.label;
  16.             url = menues[i].attributes.url;
  17.             _this["menumc_"+i]._y = 21;
  18.             if (i == 0) {
  19.                 _this["menumc_"+i]._x = 100;
  20.             } else {
  21.                 _this["menumc_"+i]._x = _this["menumc_"+(i-1)]._x+_this["menumc_"+(i-1)]._width-20;
  22.             }
  23.             _this["menumc_"+i].onRollOver = function() {
  24.                    
  25.                 menu_rollover(this);
  26.             };
  27.             _this["menumc_"+i].onRollOut = function() {
  28.                 menu_rollout(this);
  29.             };
  30.             _this["menumc_"+i].onRelease = function() {
  31.                 getURL( url , "_self" )
  32.             };
  33.         }
  34.     } else {
  35.         trace("no xml loaded");
  36.     }
  37. };
  38. function menu_rollover(mc) {
  39.     for(var i = 0; i<submenu.length; i++)
  40.         {
  41.             removeMovieClip(_this["submenu_"+i])
  42.         }
  43.     mc.gotoAndPlay("start");
  44.     var menu_num = mc._name;
  45.     menu_num = substring(menu_num, menu_num.lastIndexOf("_")+2, menu_num.length);
  46.     submenu = menues[menu_num].childNodes
  47.     for(var i=0; i<submenu.length; i++){
  48.         _this.attachMovie("submenu_mc", "submenu_"+i, i+menues.length);
  49.         _this["submenu_"+i].menutxt2.text = submenu[i].attributes.label;
  50.         url = submenu[i].attributes.url;
  51.         _this["submenu_"+i]._y = _this["menumc_"+menu_num]._y+ _this["menumc_"+menu_num]._height;
  52.         if(i == 0)
  53.         {
  54.             _this["submenu_"+i]._x = 70
  55.         }else{
  56.             _this["submenu_"+i]._x =_this["submenu_"+(i-1)]._x+ _this["submenu_"+(i-1)]._width
  57.         }
  58.         _this["submenu_"+i].onRollOver = function()
  59.         {
  60.             this.gotoAndStop(2);
  61.         }
  62.         _this["submenu_"+i].onRollOut = function()
  63.         {
  64.             this.gotoAndStop(1);
  65.         }
  66.         _this["submenu_"+i].onRelease = function() {
  67.                 getURL( url , "_self" )
  68.             };
  69.  
  70.     }
  71.    
  72. }
  73. function menu_rollout(mc) {
  74.    
  75.     mc.gotoAndPlay("out");
  76. }





Agradeceria mucho si me pdieran ayudar con este problema que me este complicando mucho.