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

    modifiche ad effetto lente

    ho scaricato questo effetto lente
    http://www.sephiroth.it/file_detail.php?id=126

    vorrei però invertire l'effetto... cioé ai lati della lente l'img sarà + grande mentre in centro sarà della dimensione originale... qualcuno sa dove dovrei mettere mano? vorrei anche fare la lente statica mentre é l'immagine a muoversi

    posto il codice
    codice:
    // variables
    img = "1.JPG";
    base_scale = 50;
    // base image scale
    base_alpha = 100;
    // base image alpha
    factor = 1;
    // lens factor
    num_lens = 10;
    // number of duplicate lens
    avariation = (100 - base_alpha) / num_lens;
    xvariation = ((100 - base_scale) / num_lens) / factor;
    // base image
    this.createEmptyMovieClip ("base", 1);
    base.createEmptyMovieClip ("cont", 1);
    base_image = base;
    base._visible = 0;
    base._alpha = base_alpha;
    base._xscale = base._yscale = base_scale;
    base.cont.loadMovie (img);
    loader.bar._xscale = 0
    base.onEnterFrame = function () {
    	if (this.cont._url != this._url) {
    		loader.bar._xscale = int((this.cont.getBytesLoaded () / this.cont.getBytesTotal ())*100)
    		if (this.cont.getBytesLoaded () >= this.cont.getBytesTotal () && this.cont.getBytesTotal () > 4 && this.cont._width > 10) {
    			this._visible = 1;
    			delete this.onEnterFrame;
    			loader._visible = 0
    			//Mouse.hide ();
    			createLens ();						
    		}
    	}
    };
    // lens (variation*alpha)
    function createLens () {
    	this.createEmptyMovieClip ("lens", 2);
    	this.lens.attachMovie ("lente", "lente", -1);
    	this.lens.lente.startDrag (true);
    	for (var a = 1; a <= num_lens; a++) {
    		this.lens.createEmptyMovieClip ("lens_container_" + a, a);
    		var container = this.lens['lens_container_' + a];
    		container.createEmptyMovieClip ("cont", 1);
    		container.createEmptyMovieClip ("cont", 1);
    		lens.attachMovie ("mask", "mask_" + a, 2000 + a);
    		container.cont.loadMovie (img);
    		container._visible = 0;
    		container._xscale = container._yscale = base_scale + (xvariation * (++b * 2));
    		container._alpha = base_alpha + (avariation * (a + 1));
    		lens['mask_' + a]._xscale = lens['mask_' + a]._yscale = 100 - (xvariation * (a - 1));
    		this.lens['lens_container_' + a].mask = lens['mask_' + a];
    		this.lens['lens_container_' + a].onEnterFrame = function () {
    			if (this.cont._url != this._url) {
    				if (this.cont.getBytesLoaded () >= this.cont.getBytesTotal () && this.cont.getBytesTotal () > 4 && this.cont._width > 10) {
    					this._visible = 1;
    					//this._alpha = base._alpha + 10
    					delete this.onEnterFrame;
    					this.cont.setMask (this.mask);
    					this.mask.control = this;
    					this.mask.startx = base_image._x;
    					this.mask.starty = base_image._y;
    					this.mask.w2 = this._width;
    					this.mask.w1 = base_image._width;
    					this.mask.h2 = this._height;
    					this.mask.h1 = base_image._height;
    					this.mask.diffx = this._width / base_image._width;
    					this.mask.diffy = this._height / base_image._height;
    					this.mask.onEnterFrame = function () {
    						this.mousex = _root._xmouse - this.startx;
    						this.mousey = _root._ymouse - this.starty;
    						this.endx = -this.mousex * this.diffx;
    						this.endy = -this.mousey * this.diffy;
    						this.control._x = this.endx + _root._xmouse;
    						this.control._y = this.endy + _root._ymouse;
    						//this._x = _root._xmouse;
    						//this._y = _root._ymouse;
    						this._x = 250;
    						this._y = 250;
    						this.updateAfterEvent ();
    					};
    					delete this.onEnterFrame;
    				}
    			}
    		};
    	}
    }
    ciao e grazie

  2. #2
    vabene anche partendo da un'altro file

  3. #3
    up...

    magari se avete altri esempi di lente

  4. #4
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    306
    se ti interessa una roba più semplice, io avevo fatto tempo fa una lente che si limitava ad ingrandire, senza fare la distorsione del vetro e la curvatura delle immagini...
    buonuomo.tomma@tiscali.it

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.