Visualizzazione dei risultati da 1 a 9 su 9
  1. #1

    effetto galleggiamento di un mc

    Ho poco tempo e lo script che ho non funziona...
    Qualcuno può aiutarmi nel far galleggiare un mc?
    Mi spiego: ho un semplice movieclip che dovrà fluttuare random lungo l'asse Y (in verticale insomma). l'oscillazione verticale dovrà essere minima e morbida. Mi date una mano?

    Ho provato questo:

    //Create the mosquitoes
    onClipEvent (load) {
    // Number of mosquitoes
    num = 1;
    // Speed of flight (higher=faster)
    maxVel = 1;
    // Set the limits of the stage
    topLim = -362;
    botLim = 20;
    leftLim = -486;
    rightLim = 0;
    // Turn off the main mosquitoe
    queenBug._visible = false;
    // Clone the main mosquito (num) times
    for (i=1; i<=num; i++) {
    queenBug.duplicateMovieClip("bug"+i, i);
    bug = this["bug"+i];
    bug._x = random(rightLim);
    bug._y = random(botLim);
    }
    }
    // Random movement code: Modify to acheive various results
    onClipEvent (enterFrame) {
    for (i=1; i<=num; i++) {
    bug = this["bug"+i];
    // Keep bugs within horizontal bounds (leftLim and rightLim)
    if (bug._x-bug._width<leftLim) {
    bug.xVel = random(maxVel);
    } else if (bug._x+bug._width>rightLim) {
    bug.xVel = -(random(maxVel));
    } else {
    bug.xVel = (random(100)>50) ? random(maxVel)+1 : -(random(maxVel))-1;
    }
    // Keep bugs within vertical bounds (botLim and topLim)
    if (bug._y-bug._height<topLim) {
    bug.yVel = random(maxVel)+80;
    } else if (bug._y+bug._height>botLim) {
    bug.yVel = -(random(maxVel))-80;
    } else {
    bug.yVel = (random(100)>50) ? random(maxVel)+1 : -(random(maxVel))-1;
    }
    // New bug location by a few random pixels dependent on speed variable maxVel
    bug.xV += bug.xVel;
    bug.yV += bug.yVel;
    if (bug.xV>maxVel*2) {
    bug.xV = maxVel*2;
    } else if (bug.xV<maxVel*-2) {
    bug.xV = maxVel*-2;
    }
    if (bug.yV>maxVel*2) {
    bug.yV = maxVel*2;
    } else if (bug.yV<maxVel*-2) {
    bug.yV = maxVel*-2;
    }
    // Set new bug location
    bug._x += bug.xV;
    bug._y += bug.yV;
    }
    }

    ma onestamente a metterci le mani muoio.... Grazie a tutti x l'aiuto
    epidurale gratuita e garantita alle donne che la chiedono!
    Firmate la petizione!

    http://www.firmiamo.it/analgesiaepiduralegratuitaegarantita

  2. #2

    nessuna idea?
    epidurale gratuita e garantita alle donne che la chiedono!
    Firmate la petizione!

    http://www.firmiamo.it/analgesiaepiduralegratuitaegarantita

  3. #3
    sostanzialmente il mio mc deve variare la sua posizione lungo l'asse y di pochi pixel. Il movimento vorrei fosse fluido... un'oscillazione...
    v prego, sto impazzendo a modificare script che non funzionano o sono tremendamente scattosi
    epidurale gratuita e garantita alle donne che la chiedono!
    Firmate la petizione!

    http://www.firmiamo.it/analgesiaepiduralegratuitaegarantita

  4. #4

  5. #5
    epidurale gratuita e garantita alle donne che la chiedono!
    Firmate la petizione!

    http://www.firmiamo.it/analgesiaepiduralegratuitaegarantita

  6. #6
    Chi Non RisiKa noN RosiKa

  7. #7
    per paolaban...

    > Disegna un piccolo insetto (o qualunque altra cosa).
    > Trasformalo in movieclip
    > assegnali nome istanza: queenBug
    > seleziona l'mc appena creato e premi F8
    > al nuovo MC che contiene il precedente (queenBug) assegna il nome che ti pare, p.es. bugContainer;
    > seleziona ora bugContainer e apri il pannello delle azioni.
    > copia e incolla il tuo codice lì, nel pannello appena aperto.

    Fatto.

    Si tratterà ora di "regolare" secondo le tue esigenze il numero di clip duplicati e i "limiti" entro i quali si devono muovere, per far ciò agisci sulle seguenti variabili:

    codice:
    // Number of mosquitoes 
    num = 1; 
    // Speed of flight (higher=faster) 
    maxVel = 1; 
    // Set the limits of the stage 
    topLim = -362; 
    botLim = 20; 
    leftLim = -486; 
    rightLim = 0;

  8. #8
    funziona! ovvero... funzionava anche prima ma ora ho capito perchè!
    Devo esportare con versione flash precedente.... grazie comunque! sei stato preziosissimo
    epidurale gratuita e garantita alle donne che la chiedono!
    Firmate la petizione!

    http://www.firmiamo.it/analgesiaepiduralegratuitaegarantita

  9. #9

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.