begin process at 2012 05 27 14:37:38
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive Flash

 > 

Archives

 > 

Menu & Navigation

 > 

menu xml avec historique d'arborescence


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

menu xml avec historique d'arborescence

dimanche 2 octobre 2005 à 15:16:02 | menu xml avec historique d'arborescence

skull21



bonjours a tous ,
alors voila mon probleme:  j'ai modifié un menu flash xml afin d'en faire un questionnaire, maintenant tout marche a merveille sauf que je souhaite garder un historique de mes recherche dans ce menu, j'arrive a trouver la 1 ere entrée la derniere et l'avant derniere mais si l'arborescence fait plus de trois niveau alors je vois pas ce qu'il ya entre ces derniers.
Voila le code AS qui permet de definir le process xml menu, ligne 950  ( en rouge) vous trouverez une serie de trace avec les references as du code. Voila j'ai la tete en choux fleur à force de chercher mais la je suis a mes limites .
merci a tous ceux qui voudront bien m'aider.

************************************************

#initclip 2
   
function trouvedp() {
}
function recherche() {
 message = (popo == "_root.gamme.c12") ? _root.c12_titre : message;
 message = (popo == "_root.gamme.c16") ? _root.c16_titre : message;
 message = (popo == "_root.gamme.c16t") ? _root.c16t_titre : message;
 message = (popo == "_root.gamme.c20") ? _root.c20_titre : message;
 message = (popo == "_root.gamme.c20t") ? _root.c20t_titre : message;
 message = (popo == "_root.gamme.c32") ? _root.c32_titre : message;
 message = (popo == "_root.gamme.c32t") ? _root.c32t0_titre : message;
 message = (popo == "_root.gamme.c36") ? _root.c36_titre : message;
 message = (popo == "_root.gamme.c36t") ? _root.c36t_titre : message;
 message = (popo == "_root.gamme.c40") ? _root.c40_titre : message;
 message = (popo == "_root.gamme.c52") ? _root.c52_titre : message;
 message = (popo == "_root.gamme.c56") ? _root.c56_titre : message;
 message = (popo == "_root.gamme.c72") ? _root.c72_titre : message;
 message = (popo == "_root.gamme.c76") ? _root.c76_titre : message;
 message = (popo == "_root.gamme.c80") ? _root.c80_titre : message;
 message = (popo == "_root.gamme.c80spe") ? _root.c80spe_titre : message;
 message = (popo == "_root.gamme.ar68rl") ? _root.ar68rl_titre : message;
 message = (popo == "_root.gamme.ar68") ? _root.ar68_titre : message;
 message = (popo == "_root.gamme.arc68") ? _root.arc68_titre : message;
 message = (popo == "_root.gamme.ar70comp") ? _root.ar70c_titre : message;
 message = (popo == "_root.gamme.ar80comp") ? _root.ar80c_titre : message;
 message = (popo == "_root.gamme.ar80") ? _root.ar80_titre : message;
 message = (popo == "_root.gamme.arc80") ? _root.arc80_titre : message;
 message = (popo == "_root.gamme.ar160comp") ? _root.ar160c_titre : message;
 message = (popo == "_root.gamme.arc160comp") ? _root.ar160c_titre : message;
 message = (popo == "_root.gamme.ar160std") ? _root.ar160_titre : message;
 message = (popo == "_root.gamme.arc160std") ? _root.arc160_titre : message;
 message = (popo == "_root.gamme.ar240") ? _root.ar240_titre : message;
 message = (popo == "_root.gamme.arc240") ? _root.arc240_titre : message;
 message = (popo == "_root.gamme.ar320") ? _root.ar320_titre : message;
 message = (popo == "_root.gamme.arc320") ? _root.arc320_titre : message;
 message = (popo == "_root.gamme.ce1r") ? _root.ce1r_titre : message;
 message = (popo == "_root.gamme.ce1rs") ? _root.ce1rs_titre : message;
 message = (popo == "_root.gamme.ce1pr") ? _root.ce1plusr_titre : message;
 message = (popo == "_root.gamme.ce2r") ? _root.ce2r_titre : message;
 message = (popo == "_root.gamme.ce2rs") ? _root.ce2rs_titre : message;
 message = (popo == "_root.gamme.ce3r") ? _root.ce3r_titre : message;
 message = (popo == "_root.gamme.ce1pr") ? _root.ce1plusr_titre : message;
 message = (popo == "_root.gamme.ce3rs") ? _root.ce3rs_titre : message;
 message = (popo == "_root.gamme.ce4r") ? _root.ce4r_titre : message;
 message = (popo == "_root.gamme.ce4rs") ? _root.ce4rs_titre : message;
 message = (popo == "_root.gamme.ce6r") ? _root.ce6r_titre : message;
 message = (popo == "_root.gamme.ce6rs") ? _root.ce6rs_titre : message;
 message = (popo == "_root.gamme.csp5") ? _root.csp5_titre : message;
 message = (popo == "_root.gamme.csp7") ? _root.csp7_titre : message;
 message = (popo == "_root.gamme.csp7t") ? _root.csp7t_titre : message;
 message = (popo == "_root.gamme.csp9") ? _root.csp9_titre : message;
 message = (popo == "_root.gamme.csp9t") ? _root.csp9t_titre : message;
 message = (popo == "_root.gamme.csp15_15") ? _root.csp15_15_titre : message;
 message = (popo == "_root.gamme.csp15_27") ? _root.csp15_27_titre : message;
 message = (popo == "_root.gamme.csp15t_15") ? _root.csp15t_15_titre : message;
 message = (popo == "_root.gamme.csp15t_27") ? _root.csp15t_27_titre : message;
 message = (popo == "_root.gamme.csp15_30") ? _root.csp15_30_titre : message;
 message = (popo == "_root.gamme.csp15_60") ? _root.csp15_60_titre : message;
 message = (popo == "_root.gamme.csp25") ? _root.csp25_titre : message;
 message = (popo == "_root.gamme.csp39") ? _root.csp39_titre : message;
 message = (popo == "_root.gamme.csp1_30") ? _root.csp1_30_titre : message;
 message = (popo == "_root.gamme.csp1_60") ? _root.csp1_60_titre : message;
 message = (popo == "_root.gamme.csp2_60") ? _root.csp2_60_titre : message;
 message = (popo == "_root.gamme.csp2_100") ? _root.csp2_100_titre : message;
 message = (popo == "_root.gamme.csp3_100") ? _root.csp3_100_titre : message;
 message = (popo == "_root.gamme.csp4_120") ? _root.csp4_120_titre : message;
 message = (popo == "_root.gamme.csp6_140") ? _root.csp6_140_titre : message;
 message = (popo == "_root.gamme.csp6_200") ? _root.csp6_200_titre : message;
 _root.i = i+1;
 _root.tampon += +i+"-  "+message+chr(13);
}
Auteur = "";
// Thanks to senocular for this setTimeout function
// [ Lien ]
_global.setTimeout = function(a, b, c, args) {
 // for a basic function call:
 if (typeof arguments[0] == "function") {
  args = arguments.slice(2);
  var ID, func = function () {
   a.apply(null, args);
   clearInterval(ID);
  };
  ID = setInterval(func, b, args);
  // for an object method call:
 } else {
  args = arguments.slice(3);
  var ID, func = function () {
   a[b].apply(a, args);
   clearInterval(ID);
  };
  ID = setInterval(func, c, args);
 }
 return ID;
};
_global.clearTimeout = clearInterval;
Array.prototype.removeVal = function(v) {
 for (var i = 0; i<this.length; i++) {
  if (this[i] == v) {
   this.splice(i, 1);
   i--;
  }
 }
};
String.prototype.removeBRs = function() {
 var arr = this.split("<br>");
 var maxl = 0;
 var idx = -1;
 var str;
 for (var i = 0; i<arr.length; i++) {
  if (arr[i].length>maxl) {
   maxl = arr[i].length;
   idx = i;
   str = arr[i];
  }
 }
 return str;
};
String.prototype.replaceChar = function(ach1, ach2) {
 var arr = this.split("");
 for (var i = 0; i<ach1.length; i++) {
  for (var j = 0; j<arr.length; j++) {
   var last = arr[j-1] != String.fromCharCode(92);
   if (arr[j] == ach1[i]) {
    if (last) {
     arr[j] = ach2[i];
    } else {
     arr.splice(j-1, 1);
     j--;
    }
   }
  }
 }
 return arr.join("");
};
// This function is made by Guy Watson a.k.a. FlashGuru ( [ Lien ])
// I changed it a bit though
Number.prototype.hextorgb = function() {
 var me = this.toString(16);
 while (me.length<6) {
  me = "0"+me;
 }
 var temp = new Object();
 temp.r = parseInt(me.substr(0, 2), 16);
 temp.g = parseInt(me.substr(2, 2), 16);
 temp.b = parseInt(me.substr(4, 2), 16);
 return temp;
};
function rgbToHex(o) {
 return (o.r << 16 | o.g << 8 | o.b);
}
Number.prototype.getLighterColor = function(diff) {
 var rgbCol = this.hextorgb();
 rgbCol.r += rgbCol.r/diff;
 rgbCol.g += rgbCol.g/diff;
 rgbCol.b += rgbCol.b/diff;
 if (rgbCol.r>255) {
  rgbCol.r = 255;
 }
 if (rgbCol.g>255) {
  rgbCol.g = 255;
 }
 if (rgbCol.b>255) {
  rgbCol.b = 255;
 }
 var hexCol = rgbToHex(rgbCol);
 return hexCol;
};
Number.prototype.getDarkerColor = function(diff) {
 var rgbCol = this.hextorgb();
 rgbCol.r -= rgbCol.r/diff;
 rgbCol.g -= rgbCol.g/diff;
 rgbCol.b -= rgbCol.b/diff;
 if (rgbCol.r<0) {
  rgbCol.r = 0;
 }
 if (rgbCol.g<0) {
  rgbCol.g = 0;
 }
 if (rgbCol.b<0) {
  rgbCol.b = 0;
 }
 var hexCol = rgbToHex(rgbCol);
 return hexCol;
};
MovieClip.prototype.drawrectangle = function(x, y, w, h, t, e, l, d) {
 this.moveTo(x, y);
 if (e) {
  this.lineStyle(t, l, 100);
 }
 this.lineTo(x+w, y);
 if (e) {
  this.lineStyle(t, d, 100);
 }
 this.lineTo(x+w, y+h);
 this.lineTo(x, y+h);
 if (e) {
  this.lineStyle(t, l, 100);
 }
 this.lineTo(x, y);
};
/*  
 Easing Equations v1.2
 March 11, 2002

 Tweening equations of every variety.

 Robert Penner
 www.robertpenner.com
 
 Changes:
 1.2
 - inline optimizations (changing t and multiplying in one step)--thanks to Tatsuo Kato for the idea
 
*/
// simple linear tweening - no easing
// t: current time, b: beginning value, c: change in value, d: duration
Math.linearTween = function(t, b, c, d) {
 return c*t/d+b;
};
/*
  ___________________________
   HFHierMenuClass 1.4
  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  (C) Copyright Hamza Fawzi - 2002
*/
HFHierMenuClass = function () {
 this.init();
};
HFHierMenuClass.prototype = new MovieClip();
HFHierMenuClass.prototype.init = function() {
 this.family = new Array();
 this.highlightedItems = new Array();
 this.radioGroups = new Array();
 this.setChangeHandler(this.changeHandler);
 if (this.applySound) {
  this.rollOverSndObj = new Sound();
  this.rollOverSndObj.attachSound(this.rollOverSnd);
  this.pressSndObj = new Sound();
  this.pressSndObj.attachSound(this.pressSnd);
 }
 this.setXMLFile(this.xmlFileName);
 if (this.menuSlide) {
  this.createEmptyMovieClip("$tmpMaskMC", -200);
 }
 this.reset();
};
HFHierMenuClass.prototype.reset = function() {
 this.totalMenuHeight = 0;
 this.totalMenuWidth = 0;
 this.depth = -1;
 this.isOnSub = false;
 this.parentPressedLabel = "";
 this.pressedLabel = "";
 this.pressedIdx = null;
 this.pressedURL = "";
 this.isOnClick = false;
 this.currentIdx = 0;
 this.nextArrays = new Array();
 this.nextNewArrays = new Array();
};
HFHierMenuClass.prototype.setXMLFile = function(xmlFile) {
 this.xmlFileName = xmlFile;
 if (this.xmlFileName == "") {
 } else {
  this.getXMLContent();
 }
};
HFHierMenuClass.prototype.getNumSeps2 = function(arr, n) {
 var counter = 0;
 for (var i = 0; i<n; i++) {
  if (arr[i] == "sep") {
   counter++;
  }
 }
 return counter;
};
HFHierMenuClass.prototype.getXMLContent = function() {
 this.xmlObj = new XML();
 this.xmlObj.load(this.xmlFileName);
 this.xmlObj.ignoreWhite = true;
 this.xmlObj.parent = this;
 this.xmlObj.onLoad = this.handle_xml_load;
};
HFHierMenuClass.prototype.handleItemNode = function(node, m) {
 var itemLabel = (node.attributes.html == "true") ? (node.attributes.name).replaceChar(["[", "]"], ["<", ">"]) : (node.attributes.name);
 var itemObj = new Object();
 itemObj.label = itemLabel;
 itemObj.subs = ((m == 1) ? (Number(node.attributes.sub)) : (Number(node.hasChildNodes())));
 itemObj.targetType = node.attributes.type;
 itemObj.target = node.attributes.target;
 itemObj.urlToLoad = node.attributes.url;
 itemObj.isCheckBox = (node.attributes.checkbox == "true");
 itemObj.checkBoxIsActive = (node.attributes.active == "true");
 itemObj.disabled = (node.attributes.disabled == "true");
 itemObj.html = (node.attributes.html == "true");
 itemObj.isBold = (node.attributes.bold == "true");
 itemObj.itemHeight = this.getTextHeight(itemLabel);
 return itemObj;
};
HFHierMenuClass.prototype.handleXMLNodeSubs = function(node, n, ch) {
 if (node.nodeName == "item") {
  var itemArray = this.handleItemNode(node, 2);
  if (ch == "") {
   this.dp.push(itemArray);
  } else {
   this["dp_"+ch].push(itemArray);
  }
 } else if (node.nodeName == "title") {
  var titleObj = {};
  titleObj.label = (node.attributes.html == "true") ? (node.attributes.name).replaceChar(["[", "]"], ["<", ">"]) : (node.attributes.name);
  titleObj.itemHeight = this.getTextHeight(titleObj.label);
  titleObj.html = (node.attributes.html == "true") ? (true) : (false);
  if (ch == "") {
   this.dp[0] = titleObj;
  } else {
   this["dp_"+ch][0] = titleObj;
  }
 } else if (node.nodeName == "sep") {
  if (ch == "") {
   this.dp.push("sep");
  } else {
   this["dp_"+ch].push("sep");
  }
  sepCounter++;
 } else if (node.nodeName == "radiogroup") {
  var RG_childNodes = node.childNodes;
  for (var u = 0; u<RG_childNodes.length; u++) {
   if (RG_childNodes[u].nodeName == "item") {
    var tempItemArray = this.handleItemNode(RG_childNodes[u], 1);
    if (ch == "") {
     this.dp.push(tempItemArray);
    } else {
     this["dp_"+ch].push(tempItemArray);
    }
   }
   if (RG_childNodes[u].nodeName == "sep") {
    if (ch == "") {
     this.dp.push("sep");
    } else {
     this["dp_"+ch].push("sep");
    }
   }
   if (RG_childNodes[u].nodeName != "item") {
    RG_childNodes.splice(u, 1);
    u--;
   }
  }
  var radioItemObj = new Object();
  radioItemObj.groupName = node.attributes.name;
  radioItemObj.dp_name = (ch == "") ? ("dp") : ("dp_"+ch);
  radioItemObj.start_idx = n-sepCounter-Number(titleExist);
  radioItemObj.end_idx = radioItemObj.start_idx+RG_childNodes.length-Number(titleExist);
  radioItemObj.active = parseInt(node.attributes.active);
  this.radioGroups.push(radioItemObj);
 }
 if (node.hasChildNodes()) {
  var cn = node.childNodes;
  var counter = cn.length;
  var count = 0;
  var old_chain = new String(ch);
  var idString = new String(n);
  var new_chain;
  if (old_chain == "") {
   new_chain = idString;
  } else {
   new_chain = old_chain+"_"+idString;
  }
  this["dp_"+new_chain] = [];
  this["dp_"+new_chain][0] = "";
  for (var i = 0; i<counter; i++) {
   if (cn[i].nodeName == "item" || cn[i].nodeName == "title" || cn[i].nodeName == "sep" || cn[i].nodeName == "radiogroup") {
    this.handleXMLNodeSubs(cn[i], (i-count), new_chain);
   }
   if (cn[i].nodeName != "item" && cn[i].nodeName != "checkgroup" && cn[i].nodeName != "null") {
    count = 0;
    count++;
   }
  }
 }
};
HFHierMenuClass.prototype.handle_xml_load = function(success) {
 if (success) {
  var sepCounter;
  if (this.firstChild.nodeName == "hiermenu") {
   this.parent.method = this.firstChild.attributes.method;
   if (this.parent.method == "2") {
    this.parent.dp = new Array();
    this.parent.dp[0] = "";
    var childs = this.firstChild.childNodes;
    for (var i = 0; i<childs.length; i++) {
     if (childs[i].nodeName == "item" || childs[i].nodeName == "title" || childs[i].nodeName == "sep") {
      this.parent.handleXMLNodeSubs(childs[i], i-count, "");
     }
     if (childs[i].nodeName != "item" && childs[i].nodeName != "null") {
      count++;
     }
    }
   } else {
    var childs = this.firstChild.childNodes;
    for (var i = 0; i<childs.length; i++) {
     var name = childs[i].nodeName;
     if (name.substring(0, 2) == "dp") {
      var titleExist;
      this.parent[name] = new Array();
      var subchilds = childs[i].childNodes;
      if (childs[i].attributes.title == "true") {
       titleExist = true;
      } else {
       titleExist = false;
       this.parent[name][0] = "";
      }
      sepCounter = 0;
      for (var j = 0; j<subchilds.length; j++) {
       if (subchilds[j].nodeName != null) {
        var itemArray = this.parent.handleItemNode(subchilds[j], 1);
        if (subchilds[j].nodeName == "radiogroup") {
         var RG_childNodes = subchilds[j].childNodes;
         for (var u = 0; u<RG_childNodes.length; u++) {
          if (RG_childNodes[u].nodeName == "item") {
           var tempItemArray = this.parent.handleItemNode(RG_childNodes[u], 1);
           this.parent[name].push(tempItemArray);
          }
          if (RG_childNodes[u].nodeName == "sep") {
           this.parent[name].push("sep");
           sepCounter++;
          }
          if (RG_childNodes[u].nodeName != "item") {
           RG_childNodes.splice(u, 1);
           u--;
          }
         }
         var radioItemObj = new Object();
         radioItemObj.groupName = subchilds[j].attributes.name;
         radioItemObj.dp_name = name;
         radioItemObj.start_idx = parseInt(j)-Number(titleExist)-sepCounter;
         radioItemObj.end_idx = radioItemObj.start_idx+RG_childNodes.length-Number(titleExist);
         radioItemObj.active = parseInt(subchilds[j].attributes.active);
         this.parent.radioGroups.push(radioItemObj);
        }
        if (titleExist) {
         var titleObj = {};
         titleObj.label = (subchilds[j].attributes.html == "true") ? (subchilds[j].attributes.name).replaceChar(["[", "]"], ["<", ">"]) : (subchilds[j].attributes.name);
         titleObj.itemHeight = this.parent.getTextHeight(titleObj.label);
         titleObj.html = (subchilds[j].attributes.html == "true") ? (true) : (false);
         if (subchilds[j].nodeName == "title") {
          this.parent[name][0] = titleObj;
         } else if (subchilds[j].nodeName == "item") {
          this.parent[name].push(itemArray);
         } else if (subchilds[j].nodeName == "sep") {
          this.parent[name].push("sep");
          sepCounter++;
         }
        } else {
         if (subchilds[j].nodeName == "item") {
          this.parent[name].push(itemArray);
         }
         if (subchilds[j].nodeName == "sep") {
          this.parent[name].push("sep");
          sepCounter++;
         }
        }
       }
      }
     }
    }
   }
  }
  this.parent.createMenu(0, 0, 0, this.parent.dp, "dp");
 } else {
  trace(" > ERROR: The file "+this.xmlFileName+" has not been found");
 }
};
HFHierMenuClass.prototype.createMenu = function(x, y, hier, dp, dp_name, ox, oy) {
 // increase depth
 ++this.depth;
 this.numSep = 0;
 this.totalMenuHeight = 0;
 // create menu mc
 var menu = this.createEmptyMovieClip("menu_"+this.depth, this.depth);
 menu._alpha = Number(!this.menuFade)*100;
 menu.treePos = hier;
 menu.depth = this.depth;
 menu.xpos = x;
 menu.ypos = y;
 if (this.menuSlide) {
  if ((this.menuType == "Vertical") || hier>0) {
   menu._x = ox;
   menu._y = y;
  } else if (this.menuType == "Horizontal" && hier == 0) {
   menu._x = x;
   menu._y = oy;
  }
 } else {
  menu._x = x;
  menu._y = y;
 }
 var parent_array = "dp";
 for (var z = 0; z<this.family.length-1; z++) {
  parent_array += "_"+this.family[z];
 }this[dp_name]
 var array_ref = this[parent_array];
 var pID = this.family[hier-1]+1+this.getNumSeps(array_ref, this.family[hier-1]);
 if (dp_name == parent_array) {
  menu.parentLabel = "";
 } else {
  menu.parentLabel = array_ref[pID].label;
 }
 menu.parentItemRef = this["menu_"+(this.depth-1)]["PItem_"+pID];
 menu.pID = pID;
 // if autoSizeWidth, get the width of the largest text
 if (this.autoSizeWidth) {
  this.menuWidth = this.getMenuWidth(dp);
 }
 var titleExist = (dp[0].label != "");
 var numTitleExist = Number(titleExist);
 // create title
 if ((this.menuType == "Vertical") || hier>0) {
  if (dp[0].label != "") {
   this.titleInitObj = new Object();
   this.titleInitObj.id = 0;
   this.titleInitObj._x = this.titleInitObj._y=0;
   this.titleInitObj.parent = this;
   this.titleInitObj.txtColor = this.titleTxtColor;
   c = dp[0].label;
   this.titleInitObj.txtAlign = "center";
   this.titleInitObj.menuItemHeight = dp[0].itemHeight;
   //this.getTextHeight(dp[0]);
   this.titleInitObj.menuWidth = this.menuWidth;
   this.titleInitObj.txtIsBold = true;
   this.titleInitObj.bgColor = this.titleBGColor;
   this.titleInitObj.isTitle = true;
   this.titleInitObj.html = dp[0].html;
   menu.attachMovie("ItemSymbol", "MTitle", 0, this.titleInitObj);
   this.totalMenuHeight += dp[0].itemHeight;
   continue;
  }
 }
 var applyRadio = false;
 radioSpecs.splice(0, radioSpecs.length);
 var radioSpecs = new Array();
 for (var c = 0; c<this.radioGroups.length; c++) {
  if (this.radioGroups[c].dp_name == dp_name) {
   applyRadio = true;
   radioSpecs.push(this.radioGroups[c]);
  }
 }
 for (var i = 1; i<dp.length; i++) {
  if (dp[i] == "sep") {
   if ((this.menuType == "Vertical") || hier>0) {
    menu.createEmptyMovieClip("sep_"+i, -(i+1));
    menu["sep_"+i]._y = this.totalMenuHeight;
    menu["sep_"+i].beginFill(this.upBGColor, 100);
    menu["sep_"+i].drawrectangle(0, 0, this.menuWidth, 8);
    menu["sep_"+i].endFill();
    menu["sep_"+i].lineStyle(0, this.blockLineColor, 100);
    menu["sep_"+i].moveTo(5, 4);
    menu["sep_"+i].lineTo(this.menuWidth-5, 4);
   }
   this.numSep += 1;
   this.totalMenuHeight += 8;
   continue;
  }
  if (dp[i].label == "") {
   continue;
  }
  // create items
  this.itemInitObj = new Object();
  if ((this.menuType == "Vertical") || hier>0) {
   this.itemInitObj._x = 0;
   this.itemInitObj._y = this.totalMenuHeight;
  } else if (this.menuType == "Horizontal" && hier == 0) {
   this.itemInitObj._x = this.totalMenuWidth;
   this.itemInitObj._y = 0;
   this.itemInitObj.firstHoriz = true;
  }
  this.totalMenuHeight += dp[i].itemHeight;
  var disabled = dp[i].disabled;
  this.TMP_menuItemHeight = this.getTextHeight(dp[i].label);
  if (this.menuType == "Horizontal" && hier == 0) {
   if (this.autoSizeMenuWidth) {
    this.menuWidth = this.getTextWidth(dp[i].label);
   }
   this.totalMenuWidth += this.menuWidth;
  }
  this.itemInitObj.id = i-this.numSep;
  this.itemInitObj.parent = this;
  this.itemInitObj.txtColor = this.upFontColor;
  this.itemInitObj.txtLabel = dp[i].label;
  this.itemInitObj.txtAlign = "left";
  this.itemInitObj.txtIsBold = dp[i].isBold;
  this.itemInitObj.bgColor = this.upBGColor;
  this.itemInitObj.menuWidth = this.menuWidth;
  this.itemInitObj.menuItemHeight = dp[i].itemHeight;
  //this.TMP_menuItemHeight;
  this.itemInitObj.hasSubs = dp[i].subs;
  this.itemInitObj.targetType = dp[i].targetType;
  this.itemInitObj.urlToLoad = dp[i].urlToLoad;
  this.itemInitObj.target = dp[i].target;
  this.itemInitObj.isCheckBox = dp[i].isCheckBox;
  this.itemInitObj.checkBoxIsActive = dp[i].checkBoxIsActive;
  this.itemInitObj.disabled = disabled;
  this.itemInitObj.html = dp[i].html;
  if (applyRadio) {
   var zid = i-this.numSep-1;
   for (var f = 0; f<radioSpecs.length; f++) {
    if (zid>=parseInt(radioSpecs[f].start_idx) && zid<=parseInt(radioSpecs[f].end_idx)) {
     this.itemInitObj.active = false;
     this.itemInitObj.radioStartIdx = parseInt(radioSpecs[f].start_idx);
     if (zid == parseInt(radioSpecs[f].active)+parseInt(radioSpecs[f].start_idx)) {
      this.itemInitObj.active = true;
     }
     this.itemInitObj.radioGroup = radioSpecs[f].groupName;
    }
   }
  }
  menu.attachMovie("ItemSymbol", ("PItem_"+i), (i+1), this.itemInitObj);
  // ******************************************
  // *** handle mouse events for menu items ***
  // ******************************************
  menu["PItem_"+i].onRollOver = function() {
   // __ reposition parent menu
   this._parent._x = this._parent.xpos;
   this._parent._y = this._parent.ypos;
   // __
   for (var f = 0; f<this.parent.highlightedItems.length; f++) {
    this.parent.highlightedItems[f].setBackgroundColor(this.parent.upBGColor);
    this.parent.highlightedItems[f].setTextColor(this.parent.upFontColor);
    this.parent.highlightedItems[f].update();
   }
   this.parent.highlightedItems.splice(0, this.parent.highlightedItems.length);
   for (var d = 0; d<this._parent.treePos; d++) {
    var mc = this.parent["menu_"+d]["PItem_"+this.parent["menu_"+(d+1)].pID];
    mc.setBackgroundColor(this.parent.overBGColor);
    mc.setTextColor(this.parent.overFontColor);
    mc.update();
    this.parent.highlightedItems.push(mc);
   }
   // __ play sound
   if (this.parent.applySound) {
    this.parent.rollOverSndObj.start();
   }
   // __
   if (this.parent.collapseTimeBool) {
    clearTimeout(this.parent.tID);
   }
   // __
   this.setBackgroundColor(this.parent.overBGColor);
   if (!this.disabled) {
    this.setTextColor(this.parent.overFontColor);
   }
   // __
   var inc = 0;
   var temp_depth = this.parent.depth;
   if ((this.hasSubs && this._parent.treePos == classRef.family.length) || this._parent.treePos == 0) {
    temp_depth += 1;
   }
   if (temp_depth>this._parent.treePos) {
    for (var k = (this._parent.treePos+1); k<=temp_depth; k++) {
     if (this._parent.treePos == 0 && this.parent.depth == 0) {
      continue;
     }
     if (this.parent["menu_"+(this._parent.treePos+1)].parentItemRef._name == this._name) {
      continue;
     }
     if (this.parent["menu_"+k] == undefined) {
      continue;
     }
     if (this.parent.menuFade) {
      this.parent["menu_"+k].onEnterFrame = function() {
       this._alpha -= this._parent.fadeRate;
       if (this._alpha<0) {
        this.removeMovieClip();
       }
      };
     } else {
      this.parent["menu_"+k].removeMovieClip();
     }
     inc++;
    }
   }
   // __
   this.parent.depth -= inc;
   // __
   if (this.parent.menuFade) {
    var fcount = 1;
    while (this.parent["menu_"+(this.parent.depth+fcount)] != undefined) {
     this.parent["menu_"+(this.parent.depth+fcount)].removeMovieClip();
     fcount += 1;
    }
   }
   // __
   this.parent.family.splice(this.parent.depth, this.parent.family.length);
   // __
   if (!this.disabled) {
    if (this._parent.treePos>0 || this.parent.menuShowChild == "onRollOver" || (this.parent.menuShowChild == "onPress" && this.parent.isOnClick)) {
     if (this.parent["menu_"+(this._parent.treePos+1)].parentItemRef._name == this._name) {
     } else {
      if (this.hasSubs) {
       var arrayProvider = "dp";
       var nexthier = this._parent.treePos+1;
       this.parent.family.push(this.id-1);
       for (var lv = 0; lv<this.parent.family.length; lv++) {
        arrayProvider += ("_"+(this.parent.family[lv]));
       }
       if ((this.parent.menuType == "Vertical") || this._parent.treePos>0) {
        var ox = this._parent._x;
        var oy = this._parent._y;
        var nextMenuX = this._parent._x+this._width+this.parent.menuXSpace;
        var nextMenuY = this._parent._y+this._y-(Number(this.parent[arrayProvider][0] != "")*this.menuItemHeight)+this.parent.menuYSpace;
       } else if (this.parent.menuType == "Horizontal" && this._parent.treePos == 0) {
        var ox = this._parent._x+this._x;
        var oy = this._parent._y;
        var nextMenuX = this._parent._x+this._x+this.parent.menuXSpace;
        var nextMenuY = this._parent._y+this.menuItemHeight+this.parent.menuYSpace;
       }
       var nextMenuWidth = (this.parent.autoSizeWidth) ? (this.parent.getMenuWidth(this.parent[arrayProvider])) : (this.parent.menuWidth);
       if ((this.parent.menuType == "Vertical") || this._parent.treePos>0) {
        var lastNextMenuX = this.parent._x+this._parent._x+this._width+this._x+nextMenuWidth;
       } else if (this.parent.menuType == "Horizontal" && this._parent.treePos == 0) {
        var lastNextMenuX = this.parent._x+this._parent._x+this._x+nextMenuWidth;
       }
       if (lastNextMenuX>this.parent.limitX) {
        var DX = lastNextMenuX-this.parent.limitX;
        if ((this.parent.menuType == "Vertical") || this._parent.treePos>0) {
         nextMenuX = this._parent._x-nextMenuWidth;
         //this.parent.getMenuWidth(this.parent[arrayProvider]);
         ox = (this.parent._x+this._parent._x);
        } else if (this.parent.menuType == "Horizontal" && this._parent.treePos == 0) {
         nextMenuX -= DX;
         ox -= DX;
        }
       }
       var nextMenuHeight = this.parent.getMenuHeight(this.parent[arrayProvider]);
       if ((this.parent._y+this._parent._y+this._y+nextMenuHeight+this.menuItemHeight)>this.parent.limitY) {
        nextMenuY = this._parent._y+this._y-nextMenuHeight+this.menuItemHeight;
        oy = nextMenuY;
        if (this._parent.treePos == 0 && this.parent.menuType == "Horizontal") {
         nextMenuY = this._parent._y+this._y-nextMenuHeight+this.menuItemHeight;
         nextMenuY -= this.menuItemHeight;
        }
       }
       this.parent.createMenu(nextMenuX, nextMenuY, (nexthier), this.parent[arrayProvider], arrayProvider, ox, oy);
      }
     }
    }
   }
   // __
   this.parent.isOnSub = true;
   // __
   this.update();
  };
  menu["PItem_"+i].onRollOut = function() {
   this.parent.isOnSub = false;
   setProperty(popo, _visible, false);
   // __
   this.setBackgroundColor(this.parent.upBGColor);
   if (!this.disabled) {
    this.setTextColor(this.parent.upFontColor);
   }
   this.update();
   // __
   if (this.parent.collapseTimeBool) {
    this.parent.tID = setTimeout(this.parent, "collapseAll", this.parent.collapseTime, []);
   }
  };
  menu["PItem_"+i].onPress = function() {
   // __
   this.setBackgroundColor(this.parent.downBGColor);
   if (!this.disabled) {
    this.setTextColor(this.parent.downFontColor);
   }
   this.update();
   // __
   if (!this.disabled) {
    if (this._parent.treePos == 0 && this.parent.menuShowChild == "onPress") {
     if (this.parent.family[0] == (this.id-1)) {
     } else {
      if (this.hasSubs) {
       this.parent.isOnClick = true;
       var arrayProvider = "dp";
       var nexthier = this._parent.treePos+1;
       this.parent.family.splice(this._parent.treePos, this.parent.family.length);
       this.parent.family.push(this.id-1);
       for (var lv = 0; lv<this.parent.family.length; lv++) {
        arrayProvider += ("_"+(this.parent.family[lv]));
       }
       if ((this.parent.menuType == "Vertical") || this._parent.treePos>0) {
        var ox = this._parent._x;
        var oy = this._parent._y;
        var nextMenuX = this._parent._x+this._width+this.parent.menuXSpace;
        var nextMenuY = this._parent._y+this._y-(Number(this.parent[arrayProvider][0] != "")*this.menuItemHeight)+this.parent.menuYSpace;
       } else if (this.parent.menuType == "Horizontal" && this._parent.treePos == 0) {
        var ox = this._parent._x+this._x;
        var oy = this._parent._y;
        var nextMenuX = this._parent._x+this._x+this.parent.menuXSpace;
        var nextMenuY = this._parent._y+this.menuItemHeight+this.parent.menuYSpace;
       }
       var nextMenuWidth = (this.parent.autoSizeWidth) ? (this.parent.getMenuWidth(this.parent[arrayProvider])) : (this.parent.menuWidth);
       if ((this.parent.menuType == "Vertical") || this._parent.treePos>0) {
        var lastNextMenuX = this.parent._x+this._parent._x+this._width+this._x+nextMenuWidth;
       } else if (this.parent.menuType == "Horizontal" && this._parent.treePos == 0) {
        var lastNextMenuX = this.parent._x+this._parent._x+this._x+nextMenuWidth;
       }
       if (lastNextMenuX>this.parent.limitX) {
        var DX = lastNextMenuX-this.parent.limitX;
        if ((this.parent.menuType == "Vertical") || this._parent.treePos>0) {
         nextMenuX = this._parent._x-nextMenuWidth;
         //this.parent.getMenuWidth(this.parent[arrayProvider]);
         ox = (this.parent._x+this._parent._x);
        } else if (this.parent.menuType == "Horizontal" && this._parent.treePos == 0) {
         nextMenuX -= DX;
         ox -= DX;
        }
       }
       var nextMenuHeight = this.parent.getMenuHeight(this.parent[arrayProvider]);
       if ((this.parent._y+this._parent._y+this._y+nextMenuHeight+this.menuItemHeight)>this.parent.limitY) {
        nextMenuY = this._parent._y+this._y-nextMenuHeight+this.menuItemHeight;
        oy = nextMenuY;
        if (this._parent.treePos == 0 && this.parent.menuType == "Horizontal") {
         nextMenuY = this._parent._y+this._y-nextMenuHeight+this.menuItemHeight;
         nextMenuY -= this.menuItemHeight;
        }
       }
       this.parent.createMenu(nextMenuX, nextMenuY, (nexthier), this.parent[arrayProvider], arrayProvider, ox, oy);
      }
     }
    }
   }
   // __ play sound
   if (this.parent.applySound) {
    this.parent.pressSndObj.start();
   }
   // __
   this.parent.isOnSub = true;
  };
  menu["PItem_"+i].onRelease = function() {
   // __
   this.setBackgroundColor(this.parent.upBGColor);
   if (!this.disabled) {
    this.setTextColor(this.parent.upFontColor);
   }
   this.update();
   // __
   this.parent.parentPressedLabel = this._parent.parentLabel;
   this.parent.pressedLabel = this.txtLabel;
   this.parent.pressedIdx = this.id-1;
   // __ put the action of every button here
   if (!this.disabled) {
    // uncomment the next line if you want the movie
    // in the attribute of the node to be loaded.
    if (this.targetType == "swf") {
     // loadMovie(this.target, _root.containerMC);
     trace("loadMovie(\""+this.target+"\")");
    } else if (this.targetType == "url") {
     getURL(this.urlToLoad);
     trace("getURL(\""+this.target+"\")");
    } else if (this.targetType == "label") {
     //////////////////////////////////

     //////////////////////////////////
     toto = this.parent.dp[1].label+"_"+this._parent.parentLabel+"_"+this.txtLabel;
     tata = this.parent.highlightedItems;
     tutu = dp[0, 1].label+"    "+dp[0, 2].label+"    "+dp[0, 3].label+"    "+dp[0, 4].label;
     titi =  dp[(this.radioGroups[i].active+1+this.getNumSeps(dp, (id+count)))].label;
     detail=this.parent.hier+"......"+array_ref+"......"+this.family;
     test =this._parent._parent.parentLabel;
     //////////////////////////////////
     //////////////////////////////////
     popo = this.target;
     setProperty(this.target, _visible, true);
     recherche();
     trouvedp();
     
     trace("nom du fichier xml:"+this.parent.xmlFilename);
     trace("entrée 1:"+this.parent.dp[1].label);
     trace("chemin complet sauf dernier:"+dp_name);
     trace("................variable jm:"+b);
     trace("avant derniere entrée:"+this._parent.parentLabel);
     trace("derniere entrée:"+this.parent.pressedLabel);
     trace("a priori depart:"+this.parent.method);
     trace("peut etre un chemin:"+this.parent.highlightedItems);
     trace("position de l'arbre:"+this._parent.treePos);
     trace("position dp sauf dernier:"+parent_array);
     trace("*******chemin du menu********:"+this.parent.family);
     trace("dernier lvl tablo:"+this.parent.highlightedItems.push(this.parent[this.parent.pID]));
     trace("toto:"+toto);
     trace("tata:"+tata);
     trace("tutu:"+tutu);
     trace("titi:"+titi);
     trace("detail:"+detail);
     trace("test:"+test);
     trace("dp       :"+dp);
     trace(popo);
    } else {
     // default action if not specified
    }
    if (this.target != undefined) {
     this.parent.pressedURL = this.target;
    } else {
     this.parent.pressedURL = this.urlToLoad;
    }
    // __ if is in a radio group
    if (this.radioGroup != undefined) {
     var lastChecked = this.parent.getRadioActiveItem(this.radioGroup+this.radioStartIdx);
     this.parent["PItem_"+lastChecked].RadioButton._visible = false;
     this.RadioButton._visible = true;
     this.parent.setRadioActiveItem(this.radioGroup, this.id-this.radioStartIdx-1);
    }
    // __ if checkbox
    if (this.isCheckBox) {
     var idx = (this.id+this.parent.getNumSeps(dp, this.id-1));
     dp[idx].checkBoxIsActive = (!this.checkBoxIsActive);
    }
   }
   // __
   this.parent.isOnSub = true;
   if (!this.disabled) {
    this.parent.handlerObj[this.parent.changeHandler]();
   }
   // __
   if (!this.disabled) {
    if (this._parent.treePos>0) {
     this.parent.collapseAll();
    }
   }
  };
  menu["PItem_"+i].onReleaseOutside = function() {
   // __
   this.setBackgroundColor(this.parent.upBGColor);
   if (!this.disabled) {
    this.setTextColor(this.parent.upFontColor);
   }
   this.update();
   // __
   this.parent.isOnSub = false;
   // __
   this.parent.collapseAll();
  };
 }
 // create border if yes
 if (this.borderState) {
  menu.createEmptyMovieClip("menuBorder", 20000);
  menu.menuBorder.lineStyle(this.borderSize, this.borderColor, 100);
  if (this.borderEmboss) {
   this.borderLightColor = this.upBGColor.getLighterColor(5);
   this.borderDarkColor = this.upBGColor.getDarkerColor(5);
  }
  if ((this.menuType == "Vertical") || hier>0) {
   if (this.embossDir == "Out") {
    menu.menuBorder.drawrectangle(0, 0, this.menuWidth, this.totalMenuHeight, this.borderSize, this.borderEmboss, this.borderLightColor, this.borderDarkColor);
   } else {
    menu.menuBorder.drawrectangle(0, 0, this.menuWidth, this.totalMenuHeight, this.borderSize, this.borderEmboss, this.borderDarkColor, this.borderLightColor);
   }
  } else if (this.menuType == "Horizontal" && hier == 0) {
   if (this.embossDir == "Out") {
    menu.menuBorder.drawrectangle(0, 0, this.totalMenuWidth, this.menuItemHeight, this.borderSize, this.borderEmboss, this.borderLightColor, this.borderDarkColor);
   } else {
    menu.menuBorder.drawrectangle(0, 0, this.totalMenuWidth, this.menuItemHeight, this.borderSize, this.borderEmboss, this.borderDarkColor, this.borderLightColor);
   }
  }
 }
 // create shadow if exist
 if (this.shadowAppear) {
  menu.createEmptyMovieClip("shadow_mc", -20000);
  menu.shadow_mc.beginFill(0x000000, 10);
  if ((this.menuType == "Vertical") || hier>0) {
   menu.shadow_mc.drawrectangle(this.shadowOffset, this.shadowOffset, this.menuWidth, this.totalMenuHeight, 0, false);
  } else if (this.menuType == "Horizontal" && hier == 0) {
   menu.shadow_mc.drawrectangle(this.shadowOffset, this.shadowOffset, this.totalMenuWidth, this.menuItemHeight, 0, false);
  }
  menu.shadow_mc.endFill();
 }
 if (this.menuFade) {
  menu.onEnterFrame = function() {
   this._alpha += this._parent.fadeRate;
   if (this._alpha>100) {
    delete this.onEnterFrame;
   }
  };
 }
 // __ slide the menu if yes
 if (this.menuSlide && hier>0) {
  // draw rectangle for mask
  this.$tmpMaskMC.clear();
  this.$tmpMaskMC.beginFill(0x000000, 0);
  if ((this.menuType == "Vertical") || hier>0) {
   this.$tmpMaskMC.drawrectangle(x-this.borderSize, y-this.borderSize, this.shadowOffset+this.menuWidth+this.borderSize, this.borderSize+this.shadowOffset+this.totalMenuHeight);
  } else if (this.menuType == "Horizontal" && hier == 0) {
   this.$tmpMaskMC.drawrectangle(x-this.borderSize, y-this.borderSize, this.shadowOffset+this.menuWidth*(dp.length-1-this.numSep)+this.borderSize, this.shadowOffset+this.menuItemHeight+this.borderSize);
  }
  this.$tmpMaskMC.endFill();
  menu.setMask(this.$tmpMaskMC);
  var slideCurrentTime = 0;
  if (this.menuType == "Vertical" || hier>1) {
   this.onEnterFrame = function() {
    if (slideCurrentTime<=this.menuSlideTime) {
     menu._x = Math.linearTween(slideCurrentTime, ox, x-ox, this.menuSlideTime);
     slideCurrentTime++;
    } else {
     delete this.onEnterFrame;
    }
   };
  } else if (this.menuType == "Horizontal" && hier == 1) {
   this.onEnterFrame = function() {
    if (slideCurrentTime<=this.menuSlideTime) {
     menu._y = Math.linearTween(slideCurrentTime, oy, y-oy, this.menuSlideTime);
     slideCurrentTime++;
    } else {
     delete this.onEnterFrame;
    }
   };
  }
 }
};
// ********************************************** //
HFHierMenuClass.prototype.getPressedLabel = function() {
 return this.pressedLabel;
};
HFHierMenuClass.prototype.getPressedIdx = function() {
 return this.pressedIdx;
};
HFHierMenuClass.prototype.getPressedURL = function() {
 return this.pressedURL;
};
HFHierMenuClass.prototype.setChangeHandler = function(ch, obj) {
 this.handlerObj = (arguments.length<2) ? this._parent : obj;
 this.changeHandler = ch;
};
HFHierMenuClass.prototype.collapseAll = function() {
 this.isOnClick = false;
 this.$tmpMaskMC.clear();
 for (var i = 1; i<=this.depth; i++) {
  if (this.menuFade) {
   this["menu_"+i].onEnterFrame = function() {
    this._alpha -= this._parent.fadeRate;
    if (this._alpha<0) {
     this.removeMovieClip();
    }
   };
  } else {
   this["menu_"+i].removeMovieClip();
  }
  this.family.splice(0, this.family.length);
 }
 for (var i = 0; i<this.highlightedItems.length; i++) {
  this.highlightedItems[i].setBackgroundColor(this.upBGColor);
  this.highlightedItems[i].setTextColor(this.upFontColor);
  this.highlightedItems[i].update();
 }
 this.highlightedItems.splice(0, this.highlightedItems.length);
 this.depth = 0;
};
// RADIO BUTTONS METHODS
HFHierMenuClass.prototype.getRadioActiveItem = function(cgn) {
 for (var i = 0; i<this.radioGroups.length; i++) {
  if (this.radioGroups[i].groupName == cgn) {
   return this.radioGroups[i].active;
   break;
  }
 }
};
HFHierMenuClass.prototype.getRadioItemLabel = function(cgn) {
 for (var i = 0; i<this.radioGroups.length; i++) {
  if (this.radioGroups[i].groupName == cgn) {
   var dp_name = this.radioGroups[i].dp_name;
   var dp = this[dp_name];
   var id = parseInt(this.radioGroups[i].active);
   var count = 0;
   for (var y = 0; y<this.id; y++) {
    if (dp[i] == "sep") {
     count++;
    }
   }
   var idx = (id+1+this.getNumSeps(dp, (id+count)));
   var label = dp[idx].label;
   return label;
   break;
  }
 }
};
HFHierMenuClass.prototype.setRadioActiveItem = function(cgn, id) {
 for (var i = 0; i<this.radioGroups.length; i++) {
  if (this.radioGroups[i].groupName == cgn) {
   this.radioGroups[i].active = id;
   break;
  }
 }
};
// CHECKBOXES METHODS
HFHierMenuClass.prototype.getCheckBoxState = function(str, id) {
 var dp = str="" ? this.dp : this["dp_"+str];
 var idx = (id+this.getNumSeps(dp, (id)))+1;
 return dp[idx].checkboxIsActive;
};
HFHierMenuClass.prototype.setCheckBoxState = function(str, id, bool) {
 var dp = str="" ? this.dp : this["dp_"+str];
 var idx = (id+this.getNumSeps(dp, (id)))+1;
 dp[idx].checkboxIsActive = bool;
};
// MISC. METHODS
HFHierMenuClass.prototype.setEnabled = function(str, id, bool) {
 var dp = this["dp_"+str];
 var idx = (id+this.getNumSeps(dp, id-1));
 dp[idx].disabled = (!bool);
};
HFHierMenuClass.prototype.onMouseDown = function() {
 if (!this.isOnSub) {
  this.collapseAll();
 }
};
HFHierMenuClass.prototype.getParentPressedLabel = function() {
 return this.parentPressedLabel;
};
HFHierMenuClass.prototype.getArrayName = function(fam) {
 var arr_name = "dp";
 for (var i = 0; i<fam.length; i++) {
  arr_name += "_"+fam[i];
 }
 return arr_name;
};
HFHierMenuClass.prototype.getNumSeps = function(arr, n) {
 var counter = 0;
 for (var i = 1; i<arr.length; i++) {
  if (arr[i] == "sep") {
   counter++;
  }
  if ((i-counter-1) == n) {
   break;
  }
 }
 return counter;
};
HFHierMenuClass.prototype.getMenuWidth = function(dp) {
 var len;
 var menuWidth = -1;
 var _tmpTxtFormat = new TextFormat();
 _tmpTxtFormat.font = this.txtFont;
 _tmpTxtFormat.size = this.txtSize;
 this._tmpTxtWidth.removeTextField();
 this.createTextField("_tmpTxtWidth", -999, 0, 0, 0, 0);
 this._tmpTxtWidth._visible = false;
 this._tmpTxtWidth.selectable = false;
 this._tmpTxtWidth.setNewTextFormat(_tmpTxtFormat);
 for (var i = ((dp[0].c == "") ? (1) : (0)); i<dp.length; i++) {
  var ctxt;
  if (i == 0) {
   ctxt = (dp[0].label).removeBRs();
  } else {
   ctxt = (dp[i].label).removeBRs();
  }
  this._tmpTxtWidth.text = ctxt;
  this._tmpTxtWidth.autoSize = "left";
  var wid = this._tmpTxtWidth._width;
  if (wid>menuWidth) {
   menuWidth = wid;
  }
 }
 menuWidth += 52;
 return menuWidth;
};
HFHierMenuClass.prototype.getTextHeight = function(txt) {
 var arr = txt.split("<br>");
 var h = ((arr.length)*this.menuItemHeight);
 for (var i = 0; i<arr.length; i++) {
  h -= i;
 }
 return (h);
};
HFHierMenuClass.prototype.getMenuHeight = function(arr) {
 var h;
 for (var i = 0; i<arr.length; i++) {
  if (arr[i] == "sep") {
   h += 8;
  } else {
   h += arr[i].itemHeight;
  }
 }
 return h;
};
HFHierMenuClass.prototype.getTextWidth = function(txt) {
 var txt2 = txt.removeValues("<br>");
 var _tmpTxtFormat = new TextFormat();
 _tmpTxtFormat.font = this.txtFont;
 _tmpTxtFormat.size = this.txtSize;
 this._tmpTxtWidth.removeTextField();
 this.createTextField("_tmpTxtWidth", -999, 0, 0, 0, 0);
 this._tmpTxtWidth.autoSize = "left";
 this._tmpTxtWidth._visible = false;
 this._tmpTxtWidth.selectable = false;
 this._tmpTxtWidth.setNewTextFormat(_tmpTxtFormat);
 this._tmpTxtWidth.text = txt2;
 return (this._tmpTxtWidth._width+52);
};
/*
 EDITED by paddy 2003-04-01
 extended methods
*/
HFHierMenuClass.prototype.editMenu = function(str, id, newValues) {
 var dp = str == "" ? this.dp : this["dp_"+str];
 var idx = (id+this.getNumSeps(dp, (id)));
 if (dp[idx] == "") {
  dp[idx] = newValues;
 } else {
  for (var props in newValues) {
   dp[idx][props] = newValues[props];
  }
 }
 if (newValues != "sep") {
  dp[idx].itemHeight = this.getTextHeight(newValues.label);
 }
};
HFHierMenuClass.prototype.addItem = function(ch, obj) {
 var arr_name = ch == "" ? "dp" : "dp_"+ch;
 var arr = ch == "" ? this.dp : this["dp_"+ch];
 if (arr == undefined) {
  this[arr_name] = new Array();
  this[arr_name][0] = "";
 }
 if (obj.itemHeight == undefined && obj != "sep") {
  obj.itemHeight = this.getTextHeight(obj.label);
 }
 this[arr_name].push(obj);
};
HFHierMenuClass.prototype.addItemAt = function(ch, idx, obj) {
 this.nextArrays.splice(0, this.nextArrays.length);
 this.nextNewArrays.splice(0, this.nextNewArrays.length);
 var arr_name = ch == "" ? "dp" : "dp_"+ch;
 var arr = ch == "" ? this.dp : this["dp_"+ch];
 var id = (idx+this.getNumSeps(dp, (idx))+1);
 if (arr == undefined) {
  this[arr_name] = new Array();
 }
 if (obj.itemHeight == undefined && obj != "sep") {
  obj.itemHeight = this.getTextHeight(obj.label);
 }
 if (obj != "sep") {
  this.getSubMenus(arr_name, id, "add");
  var sd = arr_name.substring(2, arr_name.length);
  var ad = sd.split("_");
  for (var i = 0; i<this.nextArrays.length; i++) {
   var sc = this.nextArrays[i].substring(2, this.nextArrays[i].length);
   var ac = sc.split("_");
   ac[ad.length] = parseInt(ac[ad.length]);
   ac[ad.length] += 1;
   // ****************************************
   // edited by Paddy - [ Lien ]
   // ****************************************
   for (var r = 0; r<this.radioGroups.length; r++) {
    if (this.radioGroups[r].dp_name == this.nextArrays[i]) {
     this.radioGroups[r].start_idx += 1;
     this.radioGroups[r].end_idx += 1;
     this.radioGroups[r].active += 1;
    }
   }
   // ****************************************
   this.nextNewArrays[i] = "dp"+ac.join("_");
   this[this.nextNewArrays[i]] = new Array();
   this[this.nextNewArrays[i]] = this[this.nextArrays[i]].slice();
   delete this[this.nextArrays[i]];
  }
 }
 arr.splice(id, 0, obj);
};
HFHierMenuClass.prototype.removeItemAt = function(ch, idx) {
 this.nextArrays.splice(0, this.nextArrays.length);
 this.nextNewArrays.splice(0, this.nextNewArrays.length);
 var arr_name = ch == "" ? "dp" : "dp_"+ch;
 var arr = ch == "" ? this.dp : this["dp_"+ch];
 if (arr[idx] != "sep") {
  this.getSubMenus(arr_name, idx, "remove");
  var sd = arr_name.substring(2, arr_name.length);
  var ad = sd.split("_");
  for (var i = 0; i<this.nextArrays.length; i++) {
   var sc = this.nextArrays[i].substring(2, this.nextArrays[i].length);
   var ac = sc.split("_");
   ac[ad.length] = parseInt(ac[ad.length]);
   ac[ad.length] -= 1;
   this.nextNewArrays[i] = "dp"+ac.join("_");
   this[this.nextNewArrays[i]] = new Array();
   this[this.nextNewArrays[i]] = this[this.nextArrays[i]].slice();
   delete this[this.nextArrays[i]];
  }
 }
 arr.splice(idx, 1);
};
HFHierMenuClass.prototype.getSubMenus = function(dp_name, id, s) {
 var dp = this[dp_name];
 if (s == "add") {
  for (var i = dp.length; i>=id; i--) {
   var rem_idx = (i-this.getNumSeps2(this[dp_name], i)-1);
   if (dp[i].subs) {
    var nextdp = dp_name+"_"+rem_idx;
    this.nextArrays.push(nextdp);
    this.getSubMenus(nextdp, 0, s);
   }
  }
 } else if (s == "remove") {
  for (var i = id; i<dp.length; i++) {
   var rem_idx = (i-this.getNumSeps2(this[dp_name], i)-1);
   if (dp[i].subs) {
    var nextdp = dp_name+"_"+rem_idx;
    this.nextArrays.push(nextdp);
    this.getSubMenus(nextdp, 0, s);
   }
  }
 }
};
HFHierMenuClass.prototype.refresh = function() {
 this.reset();
 this.createMenu(0, 0, 0, this.dp, "dp");
};
Object.registerClass("HFHierMenuSymbol", HFHierMenuClass);
#endinitclip
*******************************************

dimanche 2 octobre 2005 à 15:25:13 | Re : menu xml avec historique d'arborescence

skull21

voila la sortie flash :


nom du fichier xml:reponse1.xml
entrée 1:Nombre de repas par jour
chemin complet sauf dernier:dp_0_1
................variable jm:;
avant derniere entrée:100 à 200
derniere entrée:C16t
a priori depart:0
peut etre un chemin:_level0.menu.menu_0.PItem_1,_level0.menu.menu_1.PItem_2
position de l'arbre:2
position dp sauf dernier:dp_0
*******chemin du menu********:0,1
dernier lvl tablo:3
toto:Nombre de repas par jour_100 à 200_C16t
tata:_level0.menu.menu_0.PItem_1,_level0.menu.menu_1.PItem_2,
tutu:C16    C16t    C20    C20t
titi:C16
detail:......,[object Object],[object Object],[object Object],[object Object],[object Object],sep......
test:
dp       :,[object Object],[object Object],[object Object],[object Object],sep
_root.gamme.c16t
dimanche 2 octobre 2005 à 15:28:23 | Re : menu xml avec historique d'arborescence

skull21



et voici le fichier xml


Cette discussion est classée dans : message, var, root, parent, dp


Répondre à ce message

Sujets en rapport avec ce message

jeu de dessin [ par patrickgilet ] Dans un clip d'occurrence "zonedessin", j'ai limité "l'action de la souris".Normalement, on ne devrait pas pouvoir dessiner en dehors de ce cadre. Mai menu style mac [ par robertours ] Salut, je tente actuellement d'uitiliser un menu au design mac.Pour les icones de gauche, tout se passe a peu près bien, mais si on approche du menu p nom de variable & variables [ par desstrain ] salut, 4h-10,je sui bloké sur un truc stupide mais je trouve pas nam = "_root.var_zone.nom"+i;=>_root.var_zone.nom1 a pour valeur "toto"mais le pb c boutons radio, php et AS...tit pb a la con [ par funghi ] salut à tous, bon voila, j'espere que vous n'allez pas me prendre pour un gros null, mais j'ai un tit probleme tout simple en apparence, mais que je n INCREMENTATION D'UNE VARIABLE ISSUE DE PHP [ par funghi ] Salut à tous !!!j'aimerais juste savoir pourquoi le bout de code en gras suivant ne fonctione pas...un script php me renvoie ca : &donnee0=&donnee1=CA pb avec loadmovie [ par funghi ] Salut à tous !j'ai un probleme avec loadMovie : j'affiche dynamiquement des images en fonction de variables retournées par php. la où j'ai un soucis, _root ou _parent...kestion de debutant... [ par pierreglardon ] Moi memeAh gentils programmeur...Je debute en Actionscript. je vais essayer d'etre clair :jai un swf avec des boutons dessus ki fonctionnent parfaitem prob scrollpane et duplicateMovieClip [ par syland ] bonjour je suis nouveau et j'ai un gros probleme.alors voila je voudrais charger un menu dans un scrollpane.j'ai donc ce code sur mon sénario pricipal _parent _root : à se tirer les cheveux !!!! Besoin d'aide [ par tynmar ] Bonjour, je vous fais part de mon problème sur lequel j'ai passé les dernières 48 heures à me mordre les os enfouis sous les ongles. Le problème de ba rien ne s'affiche [ par aze555666 ] voila mon pb: je cherche à faire une simulation, avec 400 points, dont je change tout le temps les coordonnées. mais quand je fais tester l'animation,


Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,622 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales