Bonjour à tous, voila j'ai un petit probleme de code et je ne voie pas l'erreur :
si je laisse le code comme ça l'animation est gelée, mais les liens fonctionnent,
si je remplace la ligne (indiquée plus bas) l'animation fonctionne, mais plus les liens, qui sont undefined , Fichier introuvable....
voila la bête:
var iconSize = 128;
var xml:XML = new XML ();
xml.ignoreWhite = true;
xml.onLoad = function () {
var nodes = this.firstChild.childNodes;
fxg = this.firstChild;
for (i=0; i<total; i++) {
var t:MovieClip = _root.attachMovie("btn", "btn"+i, i);
}
numItems = nodes.length;
var root = this.firstChild.attributes;
iconSize = Number (root.iconsize);
var xpos = Number (root.x);
var ypos = Number (root.y);
var hspace = Number (root.hspacing);
var vspace = Number (root.vspacing);
for (var i = 0; i < numItems; i++) {
var t = _root.attachMovie ("mc.item", "item" + i, i + 1);
t._x = xpos;
t._y = ypos;
xpos += iconSize + hspace;
if (xpos > Stage.width - iconSize) {
ypos += iconSize + vspace;
xpos = Number(root.x);
}
var attr = nodes[i].attributes;
loadPNG (t, attr.image);
t.item.onRollOver = iconRollOver;
t.src = fxg.childNodes[i].attributes.src;
t.onPress = function() { <-------------------------------------------t.item.onPress = function() get URL(this.src);
getURL(this.src);
t.item.onRollOut = iconRollOut;
t.tooltip = attr.tooltip;
t.content = attr.content;
};
}
};
xml.load ("icons.xml");
loadPNG = function (itemClip, imageFile) {
itemClip.item.png.loadMovie (imageFile);
itemClip.shade.png.loadMovie (imageFile);
itemClip.reflection.png.loadMovie (imageFile);
itemClip.item.pngglow.png.loadMovie (imageFile);
};
merci d'avoir lu.
