Foros del Web » Creando para Internet » Flash y Actionscript »

Ayuda sobre el whell scroll en flash 8

Estas en el tema de Ayuda sobre el whell scroll en flash 8 en el foro de Flash y Actionscript en Foros del Web. Saludos... tengo un scroll al cual se requiere que además de que funcione con sus flechas y la barra, que funcione con la ruedita del ...
  #1 (permalink)  
Antiguo 29/04/2010, 03:23
 
Fecha de Ingreso: septiembre-2004
Ubicación: Vigo - Pontevedra
Mensajes: 39
Antigüedad: 19 años, 7 meses
Puntos: 1
Ayuda sobre el whell scroll en flash 8

Saludos...

tengo un scroll al cual se requiere que además de que funcione con sus flechas y la barra, que funcione con la ruedita del ratón... pues bien... no se como hacer esto... eh tratado de varias formas y no lo he conseguido... si alguien me puede echar una gran mano en este problema se lo agradecería en el alma... mi codigo es este:

Código:
}function scrollUpdate() {
	var conteudo = this._parent.conteudo;
	if (conteudo._height<this.bg._height) {
		this._visible = false;
	} else {
		this._visible = true;
	}
	var pxls_cont = conteudo._height-this.bg._height;
	var pxls_scroll = this.bg._height-this.barra._height;
	var alfa = pxls_cont/pxls_scroll;
	var vel = 2;
	var desty = -this.barra._y*alfa+this.hxini;
	desty = Math.floor(desty);
	conteudo._y = Math.floor((conteudo._y*vel+desty)/(vel+1));
}
function starmeuScroll() {
	yfin = this._parent.bg._height-this._height;
	this.startDrag("", this._x, 0, this._x, yfin);
}
function stopScroll() {
	this.stopDrag();
}
function moveScroll(dir) {
	if (dir == "stop") {
		delete controlador["onEnterFrame"];
	} else {
		var barra = this.barra;
		var vel = 4;
		if (dir == "cima") {
			var lim = 0;
			vel = vel*-1;
		} else {
			var lim = this.bg._height-barra._height;
		}
	}
	controlador.onEnterFrame = function() {
		if (dir == "baixo") {
			if (barra._y+vel<lim) {
				barra._y = barra._y+vel;
			} else {
				barra._y = lim;
			}
		} else if (barra._y+vel>lim) {
			barra._y = barra._y+vel;
		} else {
			barra._y = lim;
		}
	};
}
this.hxini = this._parent.conteudo._y;
this.onEnterFrame = scrollUpdate;
this.barra.onPress = starmeuScroll;
this.barra.onRelease = stopScroll;
this.barra.onReleaseOutside = stopScroll;
this.createEmptyMovieClip("controlador", 100);
sup.onPress = function() {
	moveScroll("cima");
};
sup.onRelease = inf.onRelease=function () {
	moveScroll("stop");
};
inf.onPress = function() {
	moveScroll("baixo");
};
inf.onRelease = function() {
	moveScroll("stop");
};
barra.useHandCursor = false;
sup.useHandCursor = false;
inf.useHandCursor = false;
Gracias de antemano por la ayuda que me puedan prestar.. la verdad estoy bastante desquiciado ya con este tema...

Saludos

Etiquetas: flash, scroll
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:00.