Bonjour à tous,

J'ai deux fichiers .swf, je souhaite charger menuXML.swf dans mon fichier main.swf principale.

Je ne vois pas mon menu.xml pourtant, en mettant du dessin dans le menu.swf, je remarque qu'il le charge correctement.
Donc je pense que le problème vient du chargement de mes données du fichier XML mais je ne vois pas quoi.

Tous mes fichiers sont au même endroit (main.swf, menuXML.swf, fichier.xml)

Voici le code sur la première frame du fichier main.swf

stop();
total = _root.getBytesTotal();
_root.onEnterFrame = function() {
charge = _root.getBytesLoaded();
part = Math.ceil((charge/total)*100);
affichage = part+" %";
barre._xscale = part;
if (part == 100) {
delete _root.onEnterFrame;
gotoAndStop(2);
}
};

Sur la 2eme frame de main.swf

stop();
loadMovie("menuXML.swf", _root.menuXML);

Dans menuXML.swf, voici une partie du code:

var linksXML = new XML();
linksXML.ignoreWhite = true;
linksXML.load("links.xml");
linksXML.onLoad = checkLoading;

function checkLoading(success) {
if (success == true) {
var rootNode = linksXML.firstChild;
var total = rootNode.childNodes.length;
//Load the links Text
var tLink = rootNode.firstChild;
for (i=0; i<total; i++) {
createLink("tLink"+i,tLink);
var totalInner = tLink.childNodes.length;
var tnLink = tLink.firstChild;
for (j=0; j<totalInner; j++) {
createLink("tnLink"+j+""+i,tnLink);
tnLink = tnLink.nextSibling;
}
tLink = tLink.nextSibling;
}
gotoAndStop(2);
}
}


Auriez-vous une idée ?

J'utilise Flash CS3 et ma publication est faite pour flashPlayer9/ActionScript2.0

Ps: je suis débutant, soyez sympa. J'espère avoir respecter les règles du forum icon_wink.gif

Grand merci.