Visualizzazione dei risultati da 1 a 8 su 8

Discussione: [mx] Rotazione foto

  1. #1

    [mx] Rotazione foto

    Ciao ragazzi,
    ho 4 foto messe a 0°,90°,180°,270°.
    Se metto il codice scritto nella vecchia maniera sul mc mi funziona.

    onClipEvent (enterFrame) {
    r += (rot-r)/5;
    this._rotation = r;
    }

    Se utilizzo la sintassi nuova non funziona come mai?????????

    _root.foto.a.onEnterFrame = function() {
    r += (rot-r)/5;
    _root.foto.a._rotation = r;
    };

    //Sono i gradi per far ruotare le foto
    posFoto = new Array("0", "90", "180", "270");

    //Richiamo l'Array
    _root.gruppo.onRelease = function() {
    _root.foto.a.rot = posFoto[0];
    }
    _root.lab.onRelease = function() {
    _root.foto.a.rot = posFoto[1];
    };
    _root.progetti.onRelease = function() {
    _root.foto.a.rot = posFoto[2];
    };
    _root.servizi.onRelease = function() {
    _root.foto.a.rot = posFoto[3];
    };


  2. #2

    Re: [mx] Rotazione foto

    Originariamente inviato da team83
    //Richiamo l'Array
    _root.gruppo.onRelease = function() {
    _root.foto.a.rot = posFoto[0];
    }
    _root.lab.onRelease = function() {
    _root.foto.a.rot = posFoto[1];
    };
    _root.progetti.onRelease = function() {
    _root.foto.a.rot = posFoto[2];
    };
    _root.servizi.onRelease = function() {
    _root.foto.a.rot = posFoto[3];
    };
    Ma così facendo usi lo stestto nome istanza per tutte 4 le clip. E' chiaro che non funziona.
    Devi dare nomi istanza diversi e univoci.

  3. #3
    Grazie per la risposta.

    Io le 4 foto le ho messe dentro un mc che si chiama foto poi dentro a.

    Hai capito?

    Ciao

  4. #4

  5. #5
    Quindi la sintassi dovrebbe essere così:

    _root.foto.a.onEnterFrame = function() {
    r += (rot-r)/5;
    _root.foto.a._rotation = r;
    };

    //Sono i gradi per far ruotare le foto
    posFoto = new Array("0", "90", "180", "270");

    _root.gruppo.onRelease = function() {
    _root.foto.a.rot = posFoto[0];
    }
    _root.lab.onRelease = function() {
    _root.foto.b.rot = posFoto[1];
    };
    _root.progetti.onRelease = function() {
    _root.foto.c.rot = posFoto[2];
    };
    _root.servizi.onRelease = function() {
    _root.foto.d.rot = posFoto[3];
    };

    giusto??????????

    ciaoooooooooo

  6. #6

  7. #7
    non mi funziona

    ciao

  8. #8
    Controlla anche il riferimento all'Array...
    il percorso è quello giusto?

    [OT]
    rempox :mavieni:
    [/OT]

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.