Visualizzazione dei risultati da 1 a 2 su 2

Discussione: fade in out

  1. #1

    fade in out

    ciao,
    come posso modificare questo actionscript in modo da far visualizzare con il fade in un'immagine mentre quella precedente svanisce col fade out?

    Con questo codice funziona ma la seconda immagine appare solo dopo che la prima è scomparsa del tutto lasciando vedere lo sfondo...
    Codice PHP:
    //: SETUP VARIABLES
    var maxVal 4;        // max number of fotos
    var oldVar 0;        // keep track of previous random number
    var newVar 0;        // used to load the next image
    var si 0;            // interval variable

    //: LOAD THE NEXT IAMGE
    function getImage() {
        
    newVar Math.floor(Math.random() * maxVal);                                // get random number
        
    if (newVar == oldVar) {                                                        // if number = old number..
            
    getImage();                                                                // get a number
        
    } else {                                                                    // else
            
    oldVar newVar;                                                        // set old to new number
            
    container_mc.loadMovie ("fotos/foto" newVar ".jpg");                // load the next image
            
    container_mc._alpha 0;                                                // set its alpha to 0
            
    this.onEnterFrame = function () {                                        // create loop
                
    if (container_mc._width 0) {                                        // check that the image has been loaded
                    
    container_mc._x Stage.width container_mc._width 2;    // center movieclip to stage
                    
    container_mc.onEnterFrame fadeIn;                                // start fading out
                    
    delete this.onEnterFrame;                                        // delete loop
                
    }
            }
        }
    }

    //: FADE IN THE CURRENT MOVIECLIP
    function fadeIn () {
        if (
    this._alpha <= 100) {                    // if the movieclips alpha is greater than 0
            
    this._alpha += 5;                        // reduce alpha by 5
        
    } else {                                    // else
            
    this._alpha 100;                        // reduce alpha to 0
            
    delete this.onEnterFrame;                // delete handler
            
    si setInterval(fadeOut2000);        // after 2 seconds, fade out the movieclip
        
    }
    }

    //: FADE OUT THE CURRENT MOVIECLIP
    function fadeOut () {
        
    clearInterval(si);                            // clear the interval variable
        
    container_mc.onEnterFrame = function() {    // create loop to fade out
            
    if (this._alpha >= 0) {                    // if the movieclips alpha is greater than 0
                
    this._alpha -= 5;                    // reduce alpha by 5
            
    } else {                                // else
                
    this._alpha 0;                    // reduce alpha to 0
                
    delete this.onEnterFrame;            // delete handler
                
    getImage();                            // load the next image
            
    }
        }
    }

    // load first image
    getImage(); 

  2. #2
    x fare quello che dici dovresti avere due contenitori e carucare quindi le foto in essi una cosa tipo..
    guarda questo 3d cè anche lo script..
    http://forum.html.it/forum/showthrea...readid=1171171

    la verità non è una meretrice che si getta al collo di chi non la vuole ma anzi essa è dotata di una così altera bellezza che anche chi sacrifica tutto per ottenerla non è sicuro di averla raggiunta !

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 © 2026 vBulletin Solutions, Inc. All rights reserved.