Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2004
    Messaggi
    23

    Lettore di rss.xml, e formattazione testo in flash

    Ciao ragazzi..
    ho un problema ...
    Il codice che segue mi genera questo movie...

    prova-rss

    Questo dovrebbe essere un ticker .. ma il problema č che, come noterete, il testo vā a capo...

    io vorrei che il testo uscisse su una singola riga..

    Ho provato, anche diminuendo l'altezza dell'area di testo e impostando la proprietā del campo testo, su "singola linea", ma non ho risolto.

    come posso risolvere il problema?

    questo č il codice:

    codice:
    // ************************************************
    //		Load XML data
    // ************************************************
    onLoad=function(){
    	loadDATA();
    }
    
    function loadDATA(){
    		var rss_xml:XML = new XML();
    		rss_xml.ignoreWhite = true;
    		rss_xml.onLoad = function(success:Boolean) {
    			if (success) {
    				processData(rss_xml);
    			} else {
    				trace("unable to load/parse cnet.xml");
    			}
    		};
    		//rss_xml.load("proxy.php");
    		rss_xml.load("rss.xml");
    }
    
    // ***********************************************
    // 		Process Data
    // ***********************************************
    
    channel_title			=	"";
    channel_desc			=	"";
    channel_copyright	=	"";
    channel_link			=	"";
    channel_lang			=	"";
    
    function processData(rm){
    	var rss = rm.firstChild.firstChild;
    	this.filmato.item_txt.text="";
    	this.filmato.item_txt.html = true;	
    	this.filmato.item_txt.styleSheet = rss_css;
    	
    	for (i=0;i<rss.childNodes.length;i++){
    		//trace(rss.childNodes[i].nodeName);
    		if (rss.childNodes[i].nodeName == "title"){
    			channel_title = rss.childNodes[i].firstChild.nodeValue;
    		}else if (rss.childNodes[i].nodeName == "description"){
    			channel_description = rss.childNodes[i].firstChild.nodeValue;
    		}else if (rss.childNodes[i].nodeName == "copyright"){
    			channel_copyright = rss.childNodes[i].firstChild.nodeValue;
    		}else if (rss.childNodes[i].nodeName == "link"){			
    			channel_link = rss.childNodes[i].firstChild.nodeValue;
    		}else if (rss.childNodes[i].nodeName == "language"){
    			channel_lang = rss.childNodes[i].firstChild.nodeValue;
    		}else if (rss.childNodes[i].nodeName == "image"){
    			var sTitle;
    			var sLink;	// link
    			var sURL;	// logo  url
    			
    			txtLogo.html = true;
    			txtLogo.htmlText="";
    			
    			for (j=0;j<rss.childNodes[i].childNodes.length;j++){
    				if (rss.childNodes[i].childNodes[j].nodeName == "title"){
    					sTitle = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
    				}else if (rss.childNodes[i].childNodes[j].nodeName == "link"){
    					sLink = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
    				}else if (rss.childNodes[i].childNodes[j].nodeName == "url"){
    					sURL = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
    				}
    			}
    		}else if (rss.childNodes[i].nodeName == "item"){
    			var itemTitle;
    			var itemDesc;
    			var itemLink;
    			
    			for (j=0;j<rss.childNodes[i].childNodes.length;j++){
    				if (rss.childNodes[i].childNodes[j].nodeName == "title"){
    					itemTitle = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
    				}else if (rss.childNodes[i].childNodes[j].nodeName == "description"){
    					itemDesc = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
    				}else if (rss.childNodes[i].childNodes[j].nodeName == "link"){
    					itemLink = rss.childNodes[i].childNodes[j].firstChild.nodeValue;
    				}
    			}
    			//rubriche = rss.childNodes[2].childNodes[2].firstChild.nodeValue;
    			//trace(rss);
    			
    			//this.filmato.item_txt.htmlText += "<table bgcolor=\"#ff0000\" width=\"100%\" height=\"3px\" border=\"1\"><tr> <td>  <a href=\"" + itemLink + "\"><font color=\"#003366\">" + itemTitle + "</font></a></td></tr></table>"
    		this.filmato.item_txt.htmlText+= "<a href=\"" + itemLink + "\"><font color=\"#003366\">" + itemTitle + "</font></a>"
    		
    		}
    		
    		
    	}
    }
    grazie mille a tutti.

  2. #2
    Utente di HTML.it L'avatar di and80
    Registrato dal
    Mar 2003
    Messaggi
    15,182
    sarebbe da vedere l'rss, potrebbe darsi che ci siano dei tag che mandano accapo dentro il feed stesso

  3. #3
    Utente di HTML.it
    Registrato dal
    Nov 2004
    Messaggi
    23
    Ciao and80,

    e grazie per aver risposto.

    Il feed segue la sintassi standard della versione 2.0 degli Rss.

    l'xml č visibile a questo link : rss.xml

    thanks ancora per l'intervento

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.