Désolé, j'ai honte. Je ne trouve pas. Je suis encore débutant quant à l'Action Script...
Voici mon code :
meuXML.onLoad = function()
{
var childs:XMLNode = meuXML.firstChild;
var childTotal:Number = childs.childNodes.length;
_global.fcn = function()
{
for (var i = 0; i<childTotal; i++)
{
if (i != selecionado)
{
_parent.bar['bt'+i].enabled = true;
_parent.bar['bt'+i].useHandCursor = true;
}
}
}
//REMOVE PREVIOUSLY STORED MOVIECLIPS
for (var i = 0; i<getTotal; i++)
{
_parent.bar['bt'+i].removeMovieClip();
}
_global.getTotal = childTotal;
_parent.bar.bt._visible = false;
//set variables
var v:Number = 4; //How Many Columns
var space:Number =2; //Space Between Products
var xIni:Number = 0; //x Cordinates
var yIni:Number = 0; //y Cordinates
var rows = bt._width + space;
var columns = bt._height + space;
//Easing Effect
function createColumns (s)
{
for (var i = 0; i<childTotal; i++)
{
posX = xIni + rows * (i % s);
posY = yIni + columns * int (i / s);
eval ("bt" + i).tween ("_x", posX, 0, "easeOutCubic", products.length);
eval ("bt" + i).tween ("_y", posY, 0, "easeOutCubic", products.length);
}
}
for (var i = 0; i<childTotal; i++) {
duplicateMovieClip ("bt", "bt" + i, i);//which item to duplicate
createColumns (v);//pass on the v variable ligne 27
/*************************/
var nName = (childs.childNodes[i].childNodes[0].firstChild.nodeValue);
var nPrice = (childs.childNodes[i].childNodes[1].firstChild.nodeValue);
var nDescription = (childs.childNodes[i].childNodes[2].firstChild.nodeValue);
var nImage = (childs.childNodes[i].childNodes[3].firstChild.nodeValue);
var nImageBig = (childs.childNodes[i].childNodes[4].firstChild.nodeValue);
_parent.bar['bt'+i].picture._alpha = 0;
_parent.bar['bt'+i].picture.alphaTo(100,.3,'easeoutcubic',i*.15);
_parent.bar['bt'+i].picture.loadMovie(nImage)
//ONLOAD GET VARIABLES FROM XML
var loadName = childs.childNodes[0].childNodes[0].firstChild.nodeValue;
var loadPrice = childs.childNodes[0].childNodes[1].firstChild.nodeValue;
var loadDescription = childs.childNodes[0].childNodes[2].firstChild.nodeValue;
var loadImage = childs.childNodes[0].childNodes[3].firstChild.nodeValue;
var loadImageBig = childs.childNodes[0].childNodes[4].firstChild.nodeValue;
_parent.bar['bt'+i].nName = nName
_parent.bar['bt'+i].nPrice = nPrice
_parent.bar['bt'+i].nDescription = nDescription
_parent.bar['bt'+i].nImage = nImage
_parent.bar['bt'+i].nImageBig = nImageBig
//ADD SOUND
//clickSound = new Sound();
//clickSound.attachSound("Click" ); // IMPORT YOUR AUDIO TO THE LIBRARY AND HAVE A LINKAGE ID NAMED "Click"
//PRODUCT ON ROLLOVER ACTION
_parent.bar['bt'+i].onRollOver = function()
{
this.fd_txt.colorTo(0xEBEBEB, 1);
//clickSound.start(); //REFER TO YOUR AUDIO ON WHICH EVER STATE
}
//PRODUCT ON ROLLOUT ACTION
_parent.bar['bt'+i].onRollOut = function()
{
this.fd_txt.colorTo(0xFFFFFF, 1);
}
//PRODUCT ON RELEASE ACTION
_parent.bar['bt'+i].onRelease = function()
{
this.fd_txt.colorTo(0xFFFFFF, 1);
_global.selecionado = this.i;
this.enabled = true;
this.useHandCursor = true;
fcn();
//UPON RELEASE OF PRODUCT BUTTON - XML LOADS IMAGE / NAME / PRICE / DESCRIPTION ON TOP RIGHT
_parent._parent.orderform._visible = false;
_parent._parent.view_cart.gotoAndStop(1);
this._parent._parent.alvo.loadMovie(this.nImageBig)
this._parent._parent.des.description_txt.htmlText = "NOM DU PRODUIT: "+this.nName+"<br/><br/>"+"PRIX : € "+this.nPrice+"<br/><br/>"+this.nDescription;
this.onEnterFrame=function()
{
percent=Math.round((this._parent._parent.alvo.getBytesLoaded()/this._parent._parent.alvo.getBytesTotal())*100);
if(!isNan(percent))
{
this._parent._parent.preloader._visible = true;
}
if(percent == 100)
{
this._parent._parent.preloader._visible = false;
delete this.onEnterFrame;
}
}
/////////////////////////////////////////////////////////////////////////////////////< choix pour la sélection des produits
this._parent._parent.alvo._alpha = 0;
this._parent._parent.alvo.alphaTo(100,.3,'easeoutcubic',i*.05);
_parent._parent.quantity_ns.value = 1;//<<<<<<<< numeric stepper quantité
_global.NAME = this.nName;
_global.PRICE = this.nPrice;
_global.QUANTITY = 1;
_parent._parent.pointure_ns.value = 0;//<<<<<<<< numeric stepper pointure
_global.POINT = 34;
_parent._parent.small.onPress = function() // bouton Small
{
_parent._parent.total_fade.gotoAndPlay(2);
this._parent.additem(new _parent._parent.CartItem("S" + " " + NAME, PRICE, QUANTITY));
}
_parent._parent.medium.onPress = function() // bouton Medium
{
_parent._parent.total_fade.gotoAndPlay(2);
this._parent.additem(new _parent._parent.CartItem("M" + " " + NAME, PRICE, QUANTITY));
}
_parent._parent.large.onPress = function() // bouton Large
{
_parent._parent.total_fade.gotoAndPlay(2);
this._parent.additem(new _parent._parent.CartItem("L" + " " + NAME, PRICE, QUANTITY));
}
_parent._parent.xlarge.onPress = function() // bouton XL
{
_parent._parent.total_fade.gotoAndPlay(2);
this._parent.additem(new _parent._parent.CartItem("XL" + " " + NAME, PRICE, QUANTITY));
}
_parent._parent.divers.onPress = function() // bouton accessoires
{
_parent._parent.total_fade.gotoAndPlay(2);
this._parent.additem(new _parent._parent.CartItem("ACC" + " " + NAME, PRICE, QUANTITY));
}
_parent._parent.point.onPress = function() // bouton pointures
{
_parent._parent.total_fade.gotoAndPlay(2);
this._parent.additem(new _parent._parent.CartItem("POINT" + " " + POINT, PRICE, QUANTITY));
}
}
}
_parent.meuScroll.scroller._y = 0; //GET SCROLLBAR TO THE TOP
//ONLOAD GET PICTURE + DESCRIPTION
_parent.alvo.loadMovie(loadImageBig)
_parent.des.description_txt.html = true;
_parent.des.description_txt.htmlText = "NOM DU PRODUIT : "+loadName+"<br /><br />"+"PRIX : € "+loadPrice+"<br /><br />"+loadDescription;
_parent._parent.divers._visible=true;
_parent._parent.Chaussures._visible=true;
_parent._parent.point._visible=true;
_parent._parent.pointure_ns._visible=true;
}