codice:
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.onRollOver = function() {
scrollButtonPressed = true;
direction = "down";
};
display_mc.down_btn.onRollOut = function() {
scrollButtonPressed = false;
};
display_mc.up_btn.onRollOver = function() {
scrollButtonPressed = true;
direction = "up";
};
display_mc.up_btn.onRollOut = function() {
scrollButtonPressed = false;
};
this.onEnterFrame = function() {
if (scrollButtonPressed) {
scroll();
}
};
sicuramente non funziona