le code xml est
<OBJECT TYPE= "MENU ">
<ITEM TYPE="folder" ACTION="null">HISTOIRE
<ITEM TYPE="folder" ACTION="null">HISTOIRE 1
<ITEM TYPE="page" ACTION="link" URL= "ENTYMOLOGIE.SWF" TARGET="_self">France</ITEM>
<ITEM TYPE="page" ACTION="link" URL= "Untitled-2.html" TARGET="_blank">Belgique</ITEM>
<ITEM TYPE="page" ACTION="link" URL= "soufi.hamza.html" TARGET="_blank">URSS </ITEM>
</ITEM>
</OBJECT>
Le code sur flash
pour un clip videonClipEvent (enterFrame) {
var mc = "";
var h = 0;
var hauteur = 20;
for (var i = 100; i<_root.vnom; i++) {
mc = _root["c" add i];
if (mc.niveau != 0) {
if (mc.cache) {
if (mc._height>.2) {
mc._height /= 1.2;
} else {
mc._height = 0;
}
} else {
if (mc._height<=hauteur) {
mc._height += (hauteur-mc._height)/4;
}
}
mc._alpha = mc._height*5;
}
h += mc._height;
_root["c" add (i+1)]._y = h;
}
}
le code flash
sur une image clé// prototype permettant de transformer le document XML en un tableau
//------------------------------------------------------------------
XML.prototype.buildObject = function(xObj, obj) {
//----- Initialise objects
if (xObj == null) {
xObj = this;
}
if (obj == null) {
obj = {};
}
var a, c, nName, nType, nValue, cCount;
//----- Add attributes to the object
for (a in xObj.attributes) {
obj[a] = xObj.attributes[a];
}
//----- Build child nodes
for (c in xObj.childNodes) {
nName = xObj.childNodes[c].nodeName;
nType = xObj.childNodes[c].nodeType;
nValue = xObj.childNodes[c].nodeValue;
if (nType == 3) {
obj._value = nValue;
obj._type = "text";
}
if (nType ==1 && nName != null) {
if (obj[nName] == null) {
obj[nName] = this.buildObject(xObj.childNodes[c], {});
} else if (obj[nName]._type != 'array') {
obj[nName] = [obj[nName]];
obj[nName]._type = "array";
}
if (obj[nName]._type == 'array') {
obj[nName].unshift(this.buildObject(xObj.childNodes[c], {}));
}
}
}
// Return object
return obj;
};
// --------------------------------------------------------------------------------
// fonction permettant de créer les Movieclips et de leur affecter les propriétés
// nécessaires
// --------------------------------------------------------------------------------
function convertXML() {
mXML = myXML.buildObject();
d = 0;
niveau = 1000;
vnom = 100;
_root.pere = new array("");
for (var i = 0; i<mXML.OBJECT.ITEM.length; i++) {
construire(mXML.OBJECT.ITEM[i], 0);
for (var j = 0; j<mXML.OBJECT.ITEM[i].ITEM.length; j++) {
construire(mXML.OBJECT.ITEM[i].ITEM[j], 1);
for (var k = 0; k<mXML.OBJECT.ITEM[i].ITEM[j].ITEM.length; k++) {
construire(mXML.OBJECT.ITEM[i].ITEM[j].ITEM[k], 2);
}
}
}
}
function construire(obj, niveau, le_pere) {
le_nom = "c" add _root.vnom++;
if (obj.TYPE == "folder") {
if (niveau == 0) {
_root.attachMovie("clip1", le_nom, _root.niveau++);
_root.pere[1] = le_nom;
} else {
_root.attachMovie("clip2", le_nom, _root.niveau++);
_root.pere[2] = le_nom;
_root[le_nom].cache = true;
_root[le_nom]._height = 0;
}
_root[le_nom].type = "folder";
_root[le_nom].gotoAndStop(1);
}
if (obj.TYPE == "page") {
_root.attachMovie("clip3", le_nom, _root.niveau++);
_root[le_nom].type = "page";
if (niveau != 0) {
_root[le_nom].cache = true;
_root[le_nom]._height = 0;
}
_root[le_nom].URL = obj.URL;
_root[le_nom].TARGET = obj.TARGET;
_root[le_nom].ACTION = obj.ACTION;
_root[le_nom].pere = le_pere;
}
_root[le_nom].pere = _root.pere[Number(niveau)];
_root[le_nom].type = obj.TYPE;
_root[le_nom].tx.t = obj._value;
_root[le_nom].tx.t.bold=true
_root[le_nom].niveau = niveau;
}
// --------------------------------------------------------------------------------
// Fonction appellée lors d'un clic sur un menu de haut niveau = folder
// --------------------------------------------------------------------------------
function clicfolder(n) {
for (var i = 100; i<vnom; i++) {
if (("c" add i)<>n) {
if (_root[n].ouvert && _root["c" add i].pere == _root[n]._name) {
if (_root["c" add i].type == "folder") {
// _root["c" add i].gotoAndStop(5);
for (var j = 100; j<vnom; j++) {
if (_root["c" add j].pere == _root["c" add i]._name) {
_root["c" add j].cache = true;
}
}
}
_root["c" add i].cache = true;
} else {
_root["c" add i].cache = true;
if (_root["c" add i].pere != _root[n]._name) {
_root["c" add i].gotoAndStop(1);
}
}
if (!_root[n].ouvert && _root["c" add i].pere == _root[n]._name) {
_root["c" add i].cache = false;
_root["c" add i].gotoAndStop(1);
//trace ("c" add i);
}
}
}
}
// --------------------------------------------------------------------------------
// Fonction appellée lors d'un clic sur un menu de niveau intermédiaire = subfolder
// --------------------------------------------------------------------------------
function clicsubfolder(n) {
for (var i = 100; i<vnom; i++) {
if (("c" add i)<>n) {
if (_root[n].ouvert && _root["c" add i].pere == _root[n]._name) {
_root["c" add i].cache = true;
}
if ((_root["c" add i].niveau == _root[n].niveau) && (_root["c" add i].type == "folder")) {
_root["c" add i].gotoAndStop(1);
for (var j = 100; j<vnom; j++) {
if (_root["c" add j].pere == _root["c" add i]._name) {
_root["c" add j].cache = true;
}
}
}
if (!_root[n].ouvert && _root["c" add i].pere == _root[n]._name) {
_root["c" add i].cache = false;
}
}
}
}
// --------------------------------------------------------------------------------
// Fonction appellée lors d'un clic sur un menu de niveau bas = page
// --------------------------------------------------------------------------------
function clicpage(n) {
var lien = _root[n].URL;
var targ = _root[n].TARGET;
getURL(lien, targ);
//trace (lien + targ);
}
// --------------------------------------------------------------------------------
// Fonction de lecture du fichier XML
// --------------------------------------------------------------------------------
function initMovie() {
myXML = new XML();
myXML.load("menu.xml");
myXML.onLoad = convertXML;
}
// --------------------------------------------------------------------------------
// LANCEMENT de la lecture du fichier XML
// --------------------------------------------------------------------------------
initMovie();
stop();
ce fla je l'ai trouvé sur ce site je connu pas trop dans les codes
