Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

thiago_php

zoom limitado

Recommended Posts

tenho o codigo que da o zoom so que eu gostaria de limitar o zoom dele.onClipEvent (load) { this._parent.mag.gotoAndStop(2); var yesc_inicial = this._yscale; var xesc_inicial = this._xscale; var xmov_inicial = this._x; var ymov_inicial = this._y; var yesc_final = yesc_inicial; var xesc_final = xesc_inicial; var xmov_final = xmov_inicial; var ymov_final = ymov_inicial; var mov = false; var mag = true; var demora = 3;}onClipEvent (enterFrame) { if (mag) { this._yscale -= (this._yscale-yesc_final)/demora; this._xscale -= (this._xscale-xesc_final)/demora; this._x -= (this._x-xmov_final)/demora; this._y -= (this._y-ymov_final)/demora; } if (mov) { this.xmov_final = this._x; this.ymov_final = this._y; }}on (rollOver) { Mouse.hide(); this._parent.cursores._visible = true;}on (rollOut) { Mouse.show(); this._parent.cursores._visible = false;}on (press) { if (mov) { startDrag(this); }}on (release, releaseOutside) { if (mag) { this.yesc_final += 10; this.xesc_final += 10; this.xmov_final -= _parent.mascara._xmouse; this.ymov_final -= _parent.mascara._ymouse; } else { this.stopDrag(); }}

Compartilhar este post


Link para o post
Compartilhar em outros sites

tenta assim, só altera essas partes

 

onClipEvent (load) {

var larMax=200

var altMax=200

 

this._parent.mag.gotoAndStop(2);

var yesc_inicial = this._yscale;

var xesc_inicial = this._xscale;

var xmov_inicial = this._x;

var ymov_inicial = this._y;

var yesc_final = yesc_inicial;

var xesc_final = xesc_inicial;

var xmov_final = xmov_inicial;

var ymov_final = ymov_inicial;

var mov = false;

var mag = true;

var demora = 3;

}

onClipEvent (enterFrame) {

if (mag) {

if(xesc_final<larMax && yesc_final <altMax ){

this._yscale -= (this._yscale-yesc_final)/demora;

this._xscale -= (this._xscale-xesc_final)/demora;

}

 

this._x -= (this._x-xmov_final)/demora;

this._y -= (this._y-ymov_final)/demora;

}

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.