var startingY:Number = display_mc.list_mc._y;
var bottom:Number = 120;
var direction:String;
function scroll() {
var speed:Number = 5; //velocità in base al numero!!!
if (direction == "up") {
if (display_mc.list_mc._y - speed + display_mc.list_mc._height > (startingY + bottom)) {
display_mc.list_mc._y -= speed;
} else {
display_mc.list_mc._y = (startingY + bottom) - display_mc.list_mc._height;
}
} else if (direction == "down") {
if (display_mc.list_mc._y + speed < startingY) {
display_mc.list_mc._y += speed;
} else {
display_mc.list_mc._y = startingY;
}
}
}
var scrollButtonPressed:Boolean = false;
display_mc.down_btn.onPress = function() {
scrollButtonPressed = true;
direction = "down";
};
display_mc.down_btn.onRelease = function() {
scrollButtonPressed = false;
};
display_mc.up_btn.onPress = function() {
scrollButtonPressed = true;
direction = "up";
};
display_mc.up_btn.onRelease = function() {
scrollButtonPressed = false;
};
this.onEnterFrame = function() {
if (scrollButtonPressed) {
scroll();
}
};
Qui sopra vedete il codice che si trova sulla linea temporale che mi fa scrollare un oggetto verso l'alto e verso il basso...Questo però funziona al PRESS e finisce col RELEASE...Io vorrei che invece si muovesse al ROLLOVER e terminasse al ROLLOUT!
Si può???
Graxxx

Rispondi quotando