home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 136 / MOBICLIC136.ISO / pc / DATA / ENG136 / ENG136_00 / ENG136_00.swf / scripts / frame_2 / DoAction.as
Text File  |  2011-07-20  |  1KB  |  42 lines

  1. function getTextById(myXML, attributeValue)
  2. {
  3.    myStyle = undefined;
  4.    myText = undefined;
  5.    myText = this.recusiveGetTextByAttribute(myXML,"id",attributeValue);
  6.    if(myText == undefined)
  7.    {
  8.       trace(attributeValue + " n\'existe pas dans XML");
  9.    }
  10.    return myText;
  11. }
  12. function recusiveGetTextByAttribute(node, attribute, attributeValue)
  13. {
  14.    var _loc2_ = 0;
  15.    while(_loc2_ < node.childNodes.length)
  16.    {
  17.       if(node.childNodes[_loc2_].attributes[attribute] == attributeValue)
  18.       {
  19.          myText = node.childNodes[_loc2_].firstChild.nodeValue;
  20.          if(node.childNodes[_loc2_].attributes.style !== undefined)
  21.          {
  22.             myStyle = node.childNodes[_loc2_].attributes.style;
  23.          }
  24.          break;
  25.       }
  26.       if(node.childNodes[_loc2_].hasChildNodes())
  27.       {
  28.          this.recusiveGetTextByAttribute(node.childNodes[_loc2_],attribute,attributeValue);
  29.       }
  30.       _loc2_ = _loc2_ + 1;
  31.    }
  32.    return myText;
  33. }
  34. detecteGrilles();
  35. gereTypes();
  36. detectMascotte();
  37. trace("listTypes " + listTypes);
  38. trace("mascotte " + mascotte);
  39. InitOk();
  40. stop();
  41. nodeLM = moduleInfo.returnNodeByPath("Module.AN.LegendesMedias");
  42.