Visualizzazione dei risultati da 1 a 8 su 8
  1. #1
    Utente di HTML.it L'avatar di morfo
    Registrato dal
    Oct 2005
    Messaggi
    85

    testo che cambia ogni tot ore

    Salve ragazzi,
    devo inserire in un sito flash un testo che venga letto da un file esterno (txt o xml) e che cambi ogni tot ore.
    Qualcuno saprebbe indicarmi dove posso trovare uno script simile??
    GRAZIE!!!

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,628

    Re:

    Di norma l'intervallo di tempo è regolato dalla funzione setInterval espressa in millisecondi....
    Un intervallo di ore mi sembra una cosa piuttosto anomala.

  3. #3
    Utente di HTML.it L'avatar di morfo
    Registrato dal
    Oct 2005
    Messaggi
    85
    si, è piuttosto anomala, ma devo far comparire una frase poetica in un sito, che mi cambi però ogni tot ore, o magari ogni giorno.

  4. #4
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,628

    Re:

    Allora conviene tenere sotto controllo la data del giorno con getDate() e dire che se il giorno è tot deve inseerire un determinato testo....

  5. #5
    Utente di HTML.it L'avatar di morfo
    Registrato dal
    Oct 2005
    Messaggi
    85
    Sapresti indicarmi dove trovare un esempio? Sembrava una cosa da niente e invece non ci salto più fuori!!!

  6. #6
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,628

    Re:

    tempo = new Date();
    giorno=tempo.getDate();
    In questo modo assegni il valore del giorno della variabile "giorno".

    A questo punto ti basterà dire:
    if(giorno==1){
    //comandi per scrivere il testo nel campo testo dinamico al primo giorno dle mese;
    }else if(giorno==2){
    //comandi per scrivere il testo nel campo testo dinamico al secondo giorno dle mese;
    }

    e via dicendo....

  7. #7
    Utente di HTML.it L'avatar di morfo
    Registrato dal
    Oct 2005
    Messaggi
    85
    ok ma tieni presente che ho circa 10/15 frasi o news che devono scorrere ciclicamente fino all'ultima e poi ripartire dalla prima...
    Prova a dare un'occhiata a questo AS: legge delle news da un file xml in sequenza, e fin qui tutto bene. I problemi sono 2:
    1 far scorrere le news senza pulsante ogni tot tempo
    2 creare un ciclo quando arriva all'ultimo nodo, facendo ripartire il tutto dal primo e non come adesso che viene bloccato tutto dal comando "breack".......

    images_xml = new XML();
    images_xml.onLoad = startImageViewer;
    images_xml.load("text.xml");
    images_xml.ignoreWhite = true;
    //
    // Show the first image and intialize variables
    function startImageViewer(success) {
    if (success == true) {
    rootNode = images_xml.firstChild;
    // 'totalImages' is the variable name set to correspond with the the dynamic text instance of 'totalImages'
    totalImages = rootNode.childNodes.length;
    // [ totalImages = rootNode.childNodes.length; ] gets the total number of childNodes (total number of image and text files) in your .xml document
    firstImageNode = rootNode.firstChild;
    currentImageNode = firstImageNode;
    // 'currentIndex' is the variable name set to correspond with the dynamic text instance of 'currentIndex'
    currentIndex = 1;
    // [ currentIndex = 1; ] sets the viewer to play the first childNode (first image and text file) in your .xml document
    updateImage(firstImageNode);
    }
    }
    //
    // Updates the current image with new image and text
    function updateImage(newImageNode) {
    // 'imagePath' is the variable name set to correspond with the .jpeg file name located in your .xml document
    imagePath = newImageNode.attributes.jpegURL;
    // 'imageText' is the variable name for the instance 'textArea'
    imageText = newImageNode.firstChild.nodeValue;
    // 'targetClip' is the instance name for the movie clip 'imageArea', this is where all your image files from your .xml document are loaded
    targetClip.loadMovie(imagePath);

    }

    next_btn.onRelease = function() {
    nextImageNode = currentImageNode.nextSibling;
    if (nextImageNode == null) {
    break;
    } else {
    currentIndex++;
    updateImage(nextImageNode);
    currentImageNode = nextImageNode;
    }
    };

  8. #8
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,628

    Re:

    Mi spiace ma con xml non ti posso aiutare.

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.