zoom pointé

lundi 4 septembre 2006 | programmation

[flash]https://www.jaiunblog.com/blog/wp-content/uploads/2006/09/mousezoom.swf,425,425[/flash]
Un petit script en flash pour faire un zoom sur un point fixe (cliquer sur un point de l’image pour zoomer)

_quality = "LOW";
this.capsule.onPress = function() {
mouseX = this._parent._xmouse-this._x-this.image._x;
mouseY = this._parent._ymouse-this._y-this.image._y;
this._x = this._parent._xmouse;
this._y = this._parent._ymouse;
this.image._x = -mouseX;
this.image._y = -mouseY;
};
var mouseListener:Object = new Object();
var ici = this;
mouseListener.onMouseDown = function() {
ici.onEnterFrame = function() {
capsule._xscale += capsule._xscale*0.05;
capsule._yscale += capsule._yscale*0.05;
};
};
mouseListener.onMouseUp = function() {
delete ici.onEnterFrame;
capsule._xscale = 100;
capsule._yscale = 100;
};
Mouse.addListener(mouseListener);

Attention les clips sont imbriqués ^^ la source .zip/flash 8

  • Unique Post


Comments are closed.