Salut tous le monde.
J'ai rédigé deux fonctions, l'une pr agrandir et l'autre pour réduire une image.je duplique avc un duplicate movie le premier clip à qui j'applique aussi la fonction. Le probleme c que qd j'applique cela au deux clip alors ça beugue. quelqu' un sait pourquoi? voila le code merci
//
mc.iniX=mc._x;
mc.iniY=mc._y;
mc.iniXscale=mc._xscale;
mc.iniYscale=mc._yscale;
// lache la souris------------------------------------------
function onRelease (monNom:String) {
mc = monNom;
mc.onRelease= function() {
//mouse.show();
trace("marche");
delete this.onEnterFrame;
this.onEnterFrame = function() {
this._xscale += (15 - this._xscale) / 2;
this._yscale += (15 - this._yscale) / 2;
//reprendre sa position
if(this._x<mc.iniX && this._y<mc.iniY){
this._x=mc.iniX;
this._y=mc.iniY;
trace("valeur de x");
}
//fin reprendre sa position
//
if (this._xscale < 75 ) {
this._xscale = mc.iniXscale;
this._yscale = mc.iniYscale;
this._x = mc.iniX;
this._y = mc.iniY;
trace(mc.iniXscale);
delete this.onEnterFrame;
}
}
}
}
//duplication du clip
duplicateMovieClip(mc,mc1,1);
setProperty(mc1,_x,115);
//rester appuyer sur la souris
function onPress (monNom:String) {
delete this.onEnterFrame();
mc = monNom;
mc.onPress=function(){
var grossissement = 150;
//mouse.hide();
trace(mc.iniX);
this._x0 = _root._xmouse - this._x;
this._y0 = _root._ymouse - this._y;
this.swapDepths(_root.niveau += 20);
this.onEnterFrame = function() {
this._x = _root._xmouse - this._x0;
this._y = _root._ymouse - this._y0;
this._ww = this._width / 2;
this._hh = this._height / 2;
this._xscale += (grossissement - this._xscale) / 3;
this._yscale += (grossissement - this._yscale) / 3;
}
}
}
onPress(mc)();
onRelease(mc)();
onPress(mc1)();
onRelease(mc1)();