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

    caricamento immagini jpg

    Volevo caricare delle immagini con questo script che in passato ho usato per caricare degli swf..
    però non funge con i jpg

    codice:
    function loadImage(_index){
    	if(_index != undefined && _index != ""){
    		this.preloader.bar._xscale = 0;
    		this.preloader.info.text = "";
    		this.imagermenu.loadMovie("immagini_design/d" + _index + ".swf");
    		this.onEnterFrame = function(){
    			var car = this.imagermenu.getBytesLoaded();
    			var tot = this.imagermenu.getBytesTotal();
    			if(car != undefined && car > 100){
    				if(!this.loading){
    					this.preloader._visible = 1;
    					this.loading = true;
    				}
    				var perc = Math.round((car * 100) / tot);
    				this.preloader.bar._xscale = perc;
    				this.preloader.info.text = "Loading menu " + this._index + " - " + perc + "%";
    				trace(perc);
    				if(car >= tot){
    					this.preloader._visible = 0;
    					this.initialized = true;
    					this.loading = false;
    					delete this.onEnterFrame;
    					this.gotoAndPlay("in");
    				}
    			}
    		};
    	}
    }
    
    this.preloader._visible = 0;
    
    if(this._index != undefined) loadImage(this._index);
    
    stop();

    sul pulsante:

    codice:
    d1.onRelease = function() {
    	_root.imagermenu._index = 1;
    	if (_root.imagermenu.initialized && _root.imagermenu._currentframe == 16) {
    		_root.imagermenu.gotoAndPlay("out");
    	} else {
    		_root.imagermenu.loadImage(_root.imagermenu._index);
    	}
    
    };

    Help...

  2. #2
    sei certo che le jpg siano "non progressive" ?? E' una condizione essenziale.

  3. #3
    Originariamente inviato da rempox
    sei certo che le jpg siano "non progressive" ?? E' una condizione essenziale.
    Ho risolto... come?
    le immagini me le ha date il cliente (jpg non progressive) le ho aperte il Fireworks ed esportate nuovamente all'80% di qualità e ora funziona...

    beh evidentemente flash non ama il lavoro degli altri

    grazie per la risposta Rempox

  4. #4
    un solo consiglio potresti ridurre un po di AS

    codice:
    function loadImage(_index){
    	if(_index != undefined && _index != ""){
    	   this.preloader.bar._xscale = 0;
    	   this.preloader.info.text = "";
    	   this.imagermenu.loadMovie("immagini_design/d" + _index + ".swf");
               this.preloader._visible = 1;
    	   this.loading = true;
    	   this.onEnterFrame = function(){
    		var car = this.imagermenu.getBytesLoaded();
    		var tot = this.imagermenu.getBytesTotal();
                    this.preloader.bar._xscale = Math.round(car/tot*100);
    		this.preloader.info.text = "Loading menu " + this._index + " - " + perc + "%";
                    if(car == tot && car >1024){
                       // caricato immagine ok
                       this.preloader._visible = 0;
    		   this.initialized = true;
    		   this.loading = false;
    		   delete this.onEnterFrame;
    		   this.gotoAndPlay("in");
    		}
    	   }
         }
    }

  5. #5
    Grazie per il "riassunto"!

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.