Buenos días, hoy un amigo me dijo que tenía una duda acerca de como añadir enlaces a los videos de YouTube en una aplicación realizada en Flash, para mi que es copiada de algún lado pero bueno... lejos de eso lo que presenta esta animación es un arbol de items en tres subniveles (videos -> 2 categorias -> subcategorias). Se intentan enlazar videos relacionados con la ciencia recreativa pero esto creo que es intranscendental.... lo importante es el código que he visto que usa y que no tengo ni idea de donde incluir los enlaces a las webs... no sé si es una tonteria o todo lo contrario pues igual la aplicación no está pensada para meter enlaces sino solamente para presentar un árbol de items. En caso de ser así... ¿se podría hacer algo por conseguir que aparecieran enlaces?

Código :

// set template not visible
_root.MenuTemplate._visible = 0;

// set initial Name and Depth Index
MenuNameIndex = 0;
_root.greatestDepth = 0

// define MenuItem count and clickedNamefor clickUp and clickDown actions
_root.menuCount = 0
_root.clicked = ""
_root.numItems = 0

// define MenuDef class
function MenuDef (MenuDefString) {
   this.index = 1;
   this.MenuString = MenuDefString;
   this.token = "";
}
// define MenuDef methods: getNextToken and peekNextToken
MenuDef.prototype.getNextToken = function () { 

   if ( this.index < length ( this.MenuString ) ) {
      nextChar = substring(this.MenuString, this.index, 1);
   
      if (nextChar == "(") {
         this.index += 1;
         this.token = nextchar;
         return this.token;
      }
      else if (nextChar == ")") {
         this.index += 1;
         this.token = nextchar;
         return this.token;
      }
      else if (nextChar == ",") {
         this.index += 1;
         this.token = nextchar;
         return this.token;
      }
       else {
           this.token    = "";
          while (nextChar != "(" and nextChar != ")" and nextChar!= ",") {
             this.token = this.token + nextChar;
             this.index += 1;
             nextChar = substring(this.MenuString, this.index, 1);
          }
   
          return this.token;
       }
   }
   else {
      return "";
   }
};

MenuDef.prototype.peekNextToken = function () { 

   if ( this.index < length ( this.MenuString ) ) {
      nextChar = substring(this.MenuString, this.index, 1);

      if (nextChar == "(") {
         this.oldindex = this.index;
         this.index += 1;
         this.token = nextchar;
         this.index = this.oldindex;
         return this.token;
      }
      else if (nextChar == ")") {
         this.oldindex = this.index;
         this.index += 1;
         this.token = nextchar;
         this.index = this.oldindex;
         return this.token;
      }
      else if (nextChar == ",") {
         this.oldindex = this.index;
         this.index += 1;
         this.token = nextchar;
         this.index = this.oldindex;
         return this.token;
      }
      else if (nextChar != "(" and nextChar != ")" and nextChar != ",") {
   
         this.oldindex = this.index;
           this.token    = "";
   
         while (nextChar != "(" and nextChar != ")" and nextChar != ",") {
            this.token = this.token + nextChar;
            this.index += 1;
            nextChar = substring(this.MenuString, this.index, 1);
         }
   
         this.index = this.oldindex;
   
         return this.token;
      }
   }
    else {
      return "";
   }
}

// create MenuStructure object with definition
_root.MenuStructure = new MenuDef("Vídeos(Bajas Temperaturas(Superconductividad,Fragilización, Punto Triple), Polímeros(Flubber,Nylon,Poliuretano))");


// define Menu function for creating logical Menu

function Menu (parent, prevBro, MenuDepthIndex) {

   // Get the new menu item number
   MenuNameIndex += 1;

   // get next token value
   var token = _root.MenuStructure.getNextToken();

   // creates MenuItem movieclip
   duplicateMovieClip (_root.MenuTemplate, "MenuItem"+MenuNameIndex, MenuNameIndex);

   // setup MenuItem initial values
   var ThisMenu = _root["MenuItem" + MenuNameIndex];
   ThisMenu.parent = parent;
   ThisMenu.followBro = null;
   ThisMenu.prevBro = prevBro;
   ThisMenu.child = null;
   ThisMenu._visible = false ;
   ThisMenu.menuNumber = MenuNameIndex;
   ThisMenu.LevelText.Leveltext = token;
   ThisMenu.dirLine._visible = false
   ThisMenu.depth = MenuDepthIndex

   // peeks following token
   var peektoken = _root.MenuStructure.peekNextToken();
   
   // creates next child
   if (peektoken == "(") {
      token = _root.MenuStructure.getNextToken();   // Sink "("
      ThisMenu.child = Menu(ThisMenu, null,MenuDepthIndex+1);
      token = _root.MenuStructure.getNextToken();   // Sink ")"
   }
   
   // peeks following token
   peektoken = _root.MenuStructure.peekNextToken();
   
   // creates following brother
   if (peektoken == ",") {
      token = _root.MenuStructure.getNextToken();   // Sink ","
      ThisMenu.followBro = Menu (parent, ThisMenu,MenuDepthIndex);
   }

   // sets button text
   if (ThisMenu.child == null) {
      ThisMenu.LevelButton.Buttontext = "-"
   } else {
      ThisMenu.LevelButton.Buttontext = "+"
   }

   //set number of Items
   _root.numItems = MenuNameIndex

   //returns MenuNumber
   return ThisMenu;
}

function setCoords (node) {
   if  (node != null) {
      node._x = 600;
      node._y = 450;
      setCoords (node.child);
      setCoords (node.followBro);
   }
}


// create Menu Object and first MenuItem visible

Menu (null,null,0);
setCoords (_root.MenuItem1)
_root.MenuItem1._x = 330
_root.MenuItem1._y = 355
_root.MenuItem1._visible = 1
_root.MenuItem1.openBrothers (1)
_root.MenuItem1.visibleBrothers ()


stop();