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

Problema con 2 scroll en 2 moviclips

Estas en el tema de Problema con 2 scroll en 2 moviclips en el foro de Flash y Actionscript en Foros del Web. Hola. Me he encontrado con un problema en Flash con el que nunca me había topado. Tengo un movieclip que contiene un scroll y que ...
  #1 (permalink)  
Antiguo 28/07/2010, 10:58
 
Fecha de Ingreso: julio-2010
Mensajes: 1
Antigüedad: 13 años, 8 meses
Puntos: 0
Problema con 2 scroll en 2 moviclips

Hola. Me he encontrado con un problema en Flash con el que nunca me había topado. Tengo un movieclip que contiene un scroll y que carga otro movieclip con función "loadmovie" en un nivel inmediatamente superior con otro scroll. Por alguna razón que no alcanzo a entender, sobre ser dos movieclips totalmente diferentes, cuando muevo el scroll del primer movieclip me mueve el scroll del segundo movieclip.

Podéis ver el problema en esta web en pruebas:
http://www.enunespai.com/proves/index02.html

El primer movieclip con scroll es el que carga desde la izquierda i el segundo movieclip con scroll es el que carga por la derecha. Si movéis los scroll veréis el problema. Lo que no entiendo es como el scroll de una película mueve el contenido del scroll de otra película cargada independientemente con la función "loadmovie" en un nivel superior...

Necesito ayuda urgente...


Este es el actionscript de cada scroll:

fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=false;
space = 20;
friction = 0.9;
speed = 4;
y = dragger._y;
top = main._y;
bottom = main._y+mask_mc._height-main._height-space;
dragger.onPress = function() {
drag = true;
this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
dragger.scrollEase();
};
dragger.onMouseUp = function() {
this.stopDrag();
drag = false;
};
bar.onPress = function() {
drag = true;
if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
this._parent.dragger._y = this._parent._ymouse;
this._parent.dragger._y = this._y+this._height-this._parent.dragger._height;
} else {
this._parent.dragger._y = this._parent._ymouse;
}
dragger.scrollEase();
};
bar.onMouseUp = function() {
drag = false;
};
moveDragger = function (d) {
if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
clearInterval(myInterval);
} else {
dragger._y += d;
dragger.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(bar._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-main._y)/speed)*friction);
main._y += dy;
};
};

He probado también a cambiar el nombre de cada elemento (dragger, main, bar... etc...) y sigue habiendo el mismo problema. También he probado a montar dos scrolls totalmente diferentes en un mismo movieclip (sin carga "loadmovie") y sigo teniendo el mismo problema...

Una ayuda no me vendría mal...
Gracias.

Etiquetas: 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 20:49.