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

    menu flash imagini che si spostano al passaggio del mouse

    Buongiorno a tutti sono nuovo di questo furum, gentilmente qualcuno sa darmi info sul codice da usare per fare un menu costituito da molte immagni che si spostano al passaggio del mouse? tipo quello che ha la forma dell'europa sul sito citroen.com? grazie mille

  2. #2
    la questione li è abbastanza complessa da spiegare ma non credo molto difficile da fare se hai buone conoscenze di actionscript 3.
    Dimmi prima a che livello sei perchè se inizio a spararti codice a palla e poi non sai capirlo è inutile.
    www.splashcode.it il blog dedicato ad ogni Web-Master

  3. #3
    grazie mircoDj per avermi risposto, diciamo che sono ad un livello basso....
    in internet ho trovato un tutorial, grazie al quale riesco ad ingrandire ed a spostare le immagini al passaggio del mouse, ma non riesco a spostare le immagini sotto e sopra il cursore del mouse....
    il codice di actrionscript che ho trovato è questo, pensavo di modificarlo visto che fa già una cosa abastanza simile a quello che vorrei fare io...

    onClipEvent(load){
    _quality = "BEST";
    var margin = 2; // tray margin
    var min = 32; // icon size at its smallest
    var max = 92; // icon size at its largest
    var span = 2.5 * min; // radius of influence
    var spacing = min + 1; // icon spacing
    var n = 10; // number of icons
    var speed = 0.15;

    var _MC = Math.cos;
    var _MS = Math.sin;
    var _s = max - min;
    var state = 0;
    var piSpan = Math.PI / span;
    var center = new Array();
    for(i = 1; i <= n; i++){
    this[i]._y = - margin;
    center[i] = (2 * i - n - 1) * spacing / 2;
    }
    tray._height = min + 2 * margin;
    this._alpha = 0;
    }

    onClipEvent(enterFrame){
    if(this._alpha < 100) this._alpha += 10;
    if (state == 0 || state == 1) temp = false; else temp = true;
    if(inside) state = Math.min(1, state + 0.2); else state = Math.max(0, state - 0.2);
    if(x != _xmouse || y != _ymouse || temp) {

    var x = _xmouse;
    var y = _ymouse;
    var x1 = tray._x;
    var x2 = x1 + tray._width;

    if(!temp){
    if( x < x1 || x > x2 || Math.abs(y) > altitude ) inside = false; else inside = true;
    }

    var altitude = min + 2 * margin + _s * state;

    for(i = 1; i <= n; i++){
    lo = center[i] - state * span;
    hi = center[i] + state * span;

    if(x <= lo) iX = hi; // mouse on the left, icon to the right
    if(x >= hi) iX = lo; // mouse on the right, icon to the left

    if(x > lo && x < hi) { // icon is influenced by mouse
    fi = piSpan * (hi - x); // 0..2pi
    cfi = _MC(fi / 2); // 1..-1
    sfi = _MS(fi) / 20; // horizontal compensation
    iX = center[i] - state * span * (cfi + sfi); // centrum ± span
    iSize = _s * (1 - cfi * cfi); // icon resize
    }
    else iSize = 0;
    _scale = 100 * (min + state * iSize)/128;
    this[i]._xscale = this[i]._yscale = _scale;
    this[i]._x = iX;
    }
    tray._width = this[n]._x - this[1]._x + this[1]._width/2 + this[n]._width/2 + 2 * margin;
    tray._x = this[1]._x - this[1]._width/2 - margin;
    }
    }


    data la mia ignoranza, non ne sono sicuro ma credo che questo sia un codice da cui possa partire per poi creare quello che voglio...

    GRAZIE MILLE!

  4. #4
    grazie mircoDj per avermi risposto, diciamo che sono ad un livello basso....
    in internet ho trovato un tutorial, grazie al quale riesco ad ingrandire ed a spostare le immagini al passaggio del mouse, ma non riesco a spostare le immagini sotto e sopra il cursore del mouse....
    il codice di actrionscript che ho trovato è questo, pensavo di modificarlo visto che fa già una cosa abastanza simile a quello che vorrei fare io...

    onClipEvent(load){
    _quality = "BEST";
    var margin = 2; // tray margin
    var min = 32; // icon size at its smallest
    var max = 92; // icon size at its largest
    var span = 2.5 * min; // radius of influence
    var spacing = min + 1; // icon spacing
    var n = 10; // number of icons
    var speed = 0.15;

    var _MC = Math.cos;
    var _MS = Math.sin;
    var _s = max - min;
    var state = 0;
    var piSpan = Math.PI / span;
    var center = new Array();
    for(i = 1; i <= n; i++){
    this[i]._y = - margin;
    center[i] = (2 * i - n - 1) * spacing / 2;
    }
    tray._height = min + 2 * margin;
    this._alpha = 0;
    }

    onClipEvent(enterFrame){
    if(this._alpha < 100) this._alpha += 10;
    if (state == 0 || state == 1) temp = false; else temp = true;
    if(inside) state = Math.min(1, state + 0.2); else state = Math.max(0, state - 0.2);
    if(x != _xmouse || y != _ymouse || temp) {

    var x = _xmouse;
    var y = _ymouse;
    var x1 = tray._x;
    var x2 = x1 + tray._width;

    if(!temp){
    if( x < x1 || x > x2 || Math.abs(y) > altitude ) inside = false; else inside = true;
    }

    var altitude = min + 2 * margin + _s * state;

    for(i = 1; i <= n; i++){
    lo = center[i] - state * span;
    hi = center[i] + state * span;

    if(x <= lo) iX = hi; // mouse on the left, icon to the right
    if(x >= hi) iX = lo; // mouse on the right, icon to the left

    if(x > lo && x < hi) { // icon is influenced by mouse
    fi = piSpan * (hi - x); // 0..2pi
    cfi = _MC(fi / 2); // 1..-1
    sfi = _MS(fi) / 20; // horizontal compensation
    iX = center[i] - state * span * (cfi + sfi); // centrum ± span
    iSize = _s * (1 - cfi * cfi); // icon resize
    }
    else iSize = 0;
    _scale = 100 * (min + state * iSize)/128;
    this[i]._xscale = this[i]._yscale = _scale;
    this[i]._x = iX;
    }
    tray._width = this[n]._x - this[1]._x + this[1]._width/2 + this[n]._width/2 + 2 * margin;
    tray._x = this[1]._x - this[1]._width/2 - margin;
    }
    }


    ti allego il file che vorrei modificare....

  5. #5
    grazie mircoDj per avermi risposto, diciamo che sono ad un livello basso....
    in internet ho trovato un tutorial, grazie al quale riesco ad ingrandire ed a spostare le immagini al passaggio del mouse, ma non riesco a spostare le immagini sotto e sopra il cursore del mouse....
    il codice di actrionscript che ho trovato è questo, pensavo di modificarlo visto che fa già una cosa abastanza simile a quello che vorrei fare io...

    onClipEvent(load){
    _quality = "BEST";
    var margin = 2; // tray margin
    var min = 32; // icon size at its smallest
    var max = 92; // icon size at its largest
    var span = 2.5 * min; // radius of influence
    var spacing = min + 1; // icon spacing
    var n = 10; // number of icons
    var speed = 0.15;

    var _MC = Math.cos;
    var _MS = Math.sin;
    var _s = max - min;
    var state = 0;
    var piSpan = Math.PI / span;
    var center = new Array();
    for(i = 1; i <= n; i++){
    this[i]._y = - margin;
    center[i] = (2 * i - n - 1) * spacing / 2;
    }
    tray._height = min + 2 * margin;
    this._alpha = 0;
    }

    onClipEvent(enterFrame){
    if(this._alpha < 100) this._alpha += 10;
    if (state == 0 || state == 1) temp = false; else temp = true;
    if(inside) state = Math.min(1, state + 0.2); else state = Math.max(0, state - 0.2);
    if(x != _xmouse || y != _ymouse || temp) {

    var x = _xmouse;
    var y = _ymouse;
    var x1 = tray._x;
    var x2 = x1 + tray._width;

    if(!temp){
    if( x < x1 || x > x2 || Math.abs(y) > altitude ) inside = false; else inside = true;
    }

    var altitude = min + 2 * margin + _s * state;

    for(i = 1; i <= n; i++){
    lo = center[i] - state * span;
    hi = center[i] + state * span;

    if(x <= lo) iX = hi; // mouse on the left, icon to the right
    if(x >= hi) iX = lo; // mouse on the right, icon to the left

    if(x > lo && x < hi) { // icon is influenced by mouse
    fi = piSpan * (hi - x); // 0..2pi
    cfi = _MC(fi / 2); // 1..-1
    sfi = _MS(fi) / 20; // horizontal compensation
    iX = center[i] - state * span * (cfi + sfi); // centrum ± span
    iSize = _s * (1 - cfi * cfi); // icon resize
    }
    else iSize = 0;
    _scale = 100 * (min + state * iSize)/128;
    this[i]._xscale = this[i]._yscale = _scale;
    this[i]._x = iX;
    }
    tray._width = this[n]._x - this[1]._x + this[1]._width/2 + this[n]._width/2 + 2 * margin;
    tray._x = this[1]._x - this[1]._width/2 - margin;
    }
    }


    ti allego il file che vorrei modificare....

  6. #6
    grazie mircoDj per avermi risposto, diciamo che sono ad un livello basso....
    in internet ho trovato un tutorial, grazie al quale riesco ad ingrandire ed a spostare le immagini al passaggio del mouse, ma non riesco a spostare le immagini sotto e sopra il cursore del mouse....
    il codice di actrionscript che ho trovato è questo, pensavo di modificarlo visto che fa già una cosa abastanza simile a quello che vorrei fare io...

    onClipEvent(load){
    _quality = "BEST";
    var margin = 2; // tray margin
    var min = 32; // icon size at its smallest
    var max = 92; // icon size at its largest
    var span = 2.5 * min; // radius of influence
    var spacing = min + 1; // icon spacing
    var n = 10; // number of icons
    var speed = 0.15;

    var _MC = Math.cos;
    var _MS = Math.sin;
    var _s = max - min;
    var state = 0;
    var piSpan = Math.PI / span;
    var center = new Array();
    for(i = 1; i <= n; i++){
    this[i]._y = - margin;
    center[i] = (2 * i - n - 1) * spacing / 2;
    }
    tray._height = min + 2 * margin;
    this._alpha = 0;
    }

    onClipEvent(enterFrame){
    if(this._alpha < 100) this._alpha += 10;
    if (state == 0 || state == 1) temp = false; else temp = true;
    if(inside) state = Math.min(1, state + 0.2); else state = Math.max(0, state - 0.2);
    if(x != _xmouse || y != _ymouse || temp) {

    var x = _xmouse;
    var y = _ymouse;
    var x1 = tray._x;
    var x2 = x1 + tray._width;

    if(!temp){
    if( x < x1 || x > x2 || Math.abs(y) > altitude ) inside = false; else inside = true;
    }

    var altitude = min + 2 * margin + _s * state;

    for(i = 1; i <= n; i++){
    lo = center[i] - state * span;
    hi = center[i] + state * span;

    if(x <= lo) iX = hi; // mouse on the left, icon to the right
    if(x >= hi) iX = lo; // mouse on the right, icon to the left

    if(x > lo && x < hi) { // icon is influenced by mouse
    fi = piSpan * (hi - x); // 0..2pi
    cfi = _MC(fi / 2); // 1..-1
    sfi = _MS(fi) / 20; // horizontal compensation
    iX = center[i] - state * span * (cfi + sfi); // centrum ± span
    iSize = _s * (1 - cfi * cfi); // icon resize
    }
    else iSize = 0;
    _scale = 100 * (min + state * iSize)/128;
    this[i]._xscale = this[i]._yscale = _scale;
    this[i]._x = iX;
    }
    tray._width = this[n]._x - this[1]._x + this[1]._width/2 + this[n]._width/2 + 2 * margin;
    tray._x = this[1]._x - this[1]._width/2 - margin;
    }
    }


    data la mia ignoranza, non ne sono sicuro ma credo che questo sia un codice da cui possa partire per poi creare quello che voglio...

    ti allego il file che vorrei modificare....

  7. #7
    per avere l'effetto rotazione dovresti usare le formule trigonometriche ...se mi dai il link del tutorial o un esempio che hai fatto vedo se riesco a fare qualcosa..
    www.splashcode.it il blog dedicato ad ogni Web-Master

  8. #8
    grazie ancora sei gentilissimo,
    io non mi ricordo più dove ho trovato il tutorial ma qualcosa di siimile lo puoi trovare qui http://flash.html.it/movie/vedi/1191...in-stile-dock/
    grazie ancora buona giornata

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.