Bonjour, je cherche a ameliorer le composant suivant: menu qui reprend l'effet du dock de mac os x (zoom sur une icone quand la souris s'approche). Dans le code actuel, il est impossible d'avoir une icone différente pour chaque bouton.
VOici le code actionscript
#initclip
function ScaleItClass() {
var target = this._parent[this._targetInstanceName];
target.useHandCursor = this.showHand;
var name = target._parent._name.substr(3, 2);
target.maxSize = this.maxSize;
target.minSize = this.minSize;
target.numBoxes = this.numBoxes;
if (name == "0") {
for (var i = 1; i<=this.numBoxes-1; i++) {
target._parent.duplicateMovieClip("box"+i, i+2);
}
box0_pos = target._parent._x;
}
target.onEnterFrame = function() {
var name = target._parent._name.substr(3, 2);
if (name == "0") {
target._parent._x = box0_pos;
} else {
target._parent._x = _root["box"+(name-1)]._width+_root["box"+(name-1)]._x;
}
var x = Math.abs(target._parent._xmouse-target._width/2);
var y = Math.abs(target._parent._ymouse-target._height/2);
var distance = Math.round(Math.abs((Math.sqrt((Math.pow(x+1, 2))+(Math.pow(y+1, 2))))));
target._parent.swapDepths(100000-x);
if (distance>(this.maxSize-this.minSize)) {
target._xscale = target._yscale=this.minSize;
} else {
target._xscale = target._yscale=this.maxSize-distance;
}
};
// hide behavior clip
this._visible = false;
}
// register the class
Object.registerClass("ScaleIt", ScaleItClass);
#endinitclip