Bonjour :)
voila j'ai essayé de develloper un diaporama a base deja existante le but etait de faire grossir le clip au passage sur une cible (ca ca marche) malheureusement je n'est pas trouvé comment faire dependre la position des differents clip par rapport a la position des autres, je laisse mon code faute de pouvoir laissser un fichier joint
TargetX = _root.Cible._x;
TailleA = _root.Cible._height;
Speed = 3;
//
this.onEnterFrame = function() {
PosX = this.Total._x;
this.Total._x += Math.round((TargetX-PosX)/Speed);
};
//
//
for (i=1; i<=5; i++) {
_root["Btn_"+i].indice = i;
_root.Total["Carre"+i].indice = i;
_root["Btn_"+i].onRelease = function() {
TargetX = _root.Cible._x-_root.Total["Carre"+this.indice]._x;
};
//
_root.Total["Carre"+i].onEnterFrame = function() {
TailleD = this._height;
if (this.hitTest(_root.Cible)) {
TailleA = _root.Cible2._height;
this._height = this._width += Math.round((TailleA-TailleD)/Speed);
} else {
TailleA = 22;
this._height = this._width += Math.round((TailleA-TailleD)/Speed);
}
};
}
l'anim se compose de 5boutons "btn+i" 1clip "total" contenant 5clips "carre+i" aligné sur x et de 2cibles "cible" "cible2"
Yo!
