Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1

    [mx] XML - Preload - Negatyve

    ciao,
    ho fatto vari test del preload che mi hai fornito, in tutti gli esperimenti sono riuscito ad adattare lo script
    rimane però una cosa che non mi riesce, ed è questa:
    codice:
    function preload() { 
    car = targetClip.getBytesLoaded(); 
    tot = targetClip.getBytesTotal(); 
    perc = Math.round((car / tot) * 100); 
    imagestat.text = "Loading... " + perc + "%";
    if (car == tot && targetClip._url != _root.url) {
    targetClip._width = 80;
    targetClip._height = 60; 
    clearInterval(a); 
    imagestat.text = "";
    targetClip._alpha=100;
    } 
    } 
    targetClip._alpha =0
    targetClip.loadMovie("images/image1.jpg"); 
    a = setInterval(preload, 200);
    mentre sul MC vuoto con n-istanza "targetClip"
    codice:
    images_xml = new XML();
    images_xml.onLoad = startImageViewer;
    images_xml.load("xml/images.xml");
    images_xml.ignoreWhite = true;
    
    function startImageViewer(success) {
    	if (success == true) {
    			rootNode = images_xml.firstChild;
    			totalImages = rootNode.childNodes.length;
    			firstImageNode = rootNode.firstChild;
    			currentImageNode = firstImageNode;
    			currentIndex = 1;
    			updateImage(firstImageNode);
    	}
    }
    
    function updateImage(newImageNode) {
    	imagePath = newImageNode.attributes.imgURL;
    	targetClip.loadMovie(imagePath);
    	imageCount = "image " + currentIndex + " of " + totalImages;
    }
    
    next_btn.onRelease = function() {
    	nextImageNode = currentImageNode.nextSibling;
    	if (nextImageNode == null) {
    		break;
    	} else {
    		currentIndex++;
    		updateImage(nextImageNode);
    		currentImageNode = nextImageNode;
    	}
    };
    
    back_btn.onRelease = function() {
    	previousImageNode = currentImageNode.previousSibling;
    	if (previousImageNode == null) {
    		break;
    	} else {
    		currentIndex--;
    		currentImageNode = previousImageNode;
    		updateImage(previousImageNode);
    	}
    };
    La domanda:
    tramite i due pulsanti passo le varie immagini, la prima appare perfettamente e passa nel "preloader"
    mentre invece le altre due no!

    vorrei che anche le altre due alla pressione del pulsante"back_btn" passassero nel "preloader"

    grazie :quipy:
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  2. #2
    ho risolto parte della questione..

    codice:
    next_btn.onRelease = function() {
            //partire preload
            a = setInterval(preload, 200);
            //ho fissato nuovamente le immagini
            targetClip._width = 120;
    	targetClip._height = 100;
    	nextImageNode = currentImageNode.nextSibling;
    	if (nextImageNode == null) {
    		break;
    	} else {
    		currentIndex++;
    		updateImage(nextImageNode);
    		currentImageNode = nextImageNode;
    	}
    };
    ho fissato nuovamente xchè non le dimensionava perfettamente..
    inoltre..
    adesso meno, ma sia con fissaggio che senza nei pulsanti.. le immagini non si fermano perfettamente nel punto prestabilito!
    diciamo che fanno un leggero scatto di qualche pixel in basso e a dx
    prima di dare la dimensione scelta!

    qualcosa mi sfugge.. :quipy:

    ciao a tutti
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  3. #3
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Uhm, dovresti rendere invisibile l'immagine al caricamento, e renderla visibile a caricamento completo DOPO il ridimensionamento..

  4. #4
    chi ha cambiato il titolo?

    false--- true--- Uhm..
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  5. #5
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    >chi ha cambiato il titolo?

    Io, così si capisce che si parla di immagini e non di filmati.
    Hai capito la mia risposta a proposito del renderlo visibile dopo o sono stato troppo criptico?

  6. #6
    con :
    codice:
    _visible=true;
    _visible=false;
    niente..
    nemmeno con:
    codice:
    _visible=0;
    _visible=1;
    :bubu:
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  7. #7
    messagggio quasi simultaneo.. :gren:

    si si lo sapevo che eri tu! era una battuta..
    cmq come vedi.. non ci sono! :master:

    prova ad essere meno "criptico"
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  8. #8
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    codice:
    images_xml = new XML();
    images_xml.onLoad = startImageViewer;
    images_xml.load("xml/images.xml");
    images_xml.ignoreWhite = true;
    
    function startImageViewer(success) {
    	if (success == true) {
    			rootNode = images_xml.firstChild;
    			totalImages = rootNode.childNodes.length;
    			firstImageNode = rootNode.firstChild;
    			currentImageNode = firstImageNode;
    			currentIndex = 1;
    			updateImage(firstImageNode);
    	}
    }
    
    function updateImage(newImageNode, wdt, hgt) {
    	imagePath = newImageNode.attributes.imgURL;
    	targetClip._alpha = 0;
    	a = setInterval(preload, 200, wdt, hgt);
    	targetClip.loadMovie(imagePath);
    	imageCount = "image " + currentIndex + " of " + totalImages;
    }
    
    next_btn.onRelease = function()
    {
    	nextImageNode = currentImageNode.nextSibling;
    	if (nextImageNode == null) {
    		break;
    	} else {
    		currentIndex++;
    		updateImage(nextImageNode, 120, 100);
    		currentImageNode = nextImageNode;
    	}
    };
    
    
    function preload(wdt, hgt) { 
    	car = targetClip.getBytesLoaded(); 
    	tot = targetClip.getBytesTotal(); 
    	perc = Math.round((car / tot) * 100); 
    	imagestat.text = "Loading... " + perc + "%";
    	if (car == tot && targetClip._url != _root.url) {
    		targetClip._width = wdt;
    		targetClip._height = hgt; 
    		clearInterval(a); 
    		imagestat.text = "";
    		targetClip._alpha=100;
    	}
    }

  9. #9
    :master: uhmm..

    qualcosa non quadra..
    la prima la apre in dimensione originale (550x360 circa)
    le altre due invece le posiziona perfettamente e dimensionate!

    ma non è tutto..
    nel tornare indietro le apre correttamente compreso la prima e lo stesso se riparto..

    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  10. #10
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Perchè la prima viene caricata in modo diverso dalle altre, visto che non viene caricata tramite i pulsanti. Devi riprodurre la richiesta anche per quella:

    codice:
    	imagePath = newImageNode.attributes.imgURL;
    	targetClip._alpha = 0;
    	a = setInterval(preload, 200, wdt, hgt);
    	targetClip.loadMovie(imagePath);

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.