Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Scroll al rollover

  1. #1

    Scroll al rollover

    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

  2. #2
    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

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.