Problema : abilitare i tag per i link !!!
Visualizzo solo :24/10/2004 Questo è un
... e le successive news.
..Ma come inserisco i link ???
//file XML:
<?xml version='1.0'?>
<newsblock>
<news date='24/10/2004'>Questo è un <u>collegamento</u> e quello qui sotto è altro bla bla bla...Nuovo sistema di news tramite l'uso di file XML esterno.Il tutto è realizzato tramite un components realizzato con FlashMX, che permette la gestione di news in maniera semplice e facilmente gestibile.
</news>
</newsblock>
//-----------------------------------
// codice su MC:
function newsBlock() {
_global.ref = this;
this.init();
}
newsBlock.prototype = new MovieClip();
Object.registerClass("newsBlock", newsBlock);
// init
newsBlock.prototype.init = function() {
ref._x = Math.round(ref._x);
ref._y = Math.round(ref._y);
ref.componentWidth = ref._width;
ref.componentHeight = ref._height;
ref._xscale = ref._yscale=100;
ref.boundingBox_mc._visible = false;
ref.add_borders();
ref.attachMovie("textBlock_mc", "textBlock_mc", 5);
ref.textBlock_mc.news_txt.html = true;//<------è settato !!!
ref.textBlock_mc.news_txt.selectable = ref.t_select;
ref.textBlock_mc.news_txt.textColor = this.t_color.toString(16);
ref.textBlock_mc.news_txt.text = "loading XML data";
ref.setSize(ref.componentWidth, ref.componentHeight);
//
// ----------
var newsXML = new XML(this);
newsXML.ignoreWhite = true;
newsXML.onLoad = function(success) {
if (success) {
if (this.loaded && this.hasChildNodes) {
ref.news_content = new Array();
ref.news_date = new Array();
if (this.firstChild.nodeName.toLowerCase() == "newsblock") {
var nm = this.firstChild.childNodes;
for (var i = 0; i<=nm.length; i++) {
if (nm[i].nodeName == "news") {
ref.news_date.push(nm[i].attributes.date);
ref.news_content.push(nm[i].firstChild.nodeValue);
}
}
}
}
ref.show_news2();
}
};
newsXML.load("mio_file.xml");
};
newsBlock.prototype.add_borders = function() {
this.attachMovie("border_up", "border_up", 1);
this.attachMovie("border_down", "border_down", 2);
this.attachMovie("border_left", "border_left", 3);
this.attachMovie("border_right", "border_right", 4);
};
newsBlock.prototype.show_news = function(n) {
ref.textBlock_mc.news_txt.htmlText = "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_d ate[n]+"</FONT>"+"
"+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_c ontent[n]+"</FONT>"+"
<A HREF=\"asfunction:ref.show_news2,"+i+"\"><FONT COLOR='#"+ref.l_color.toString(16)+"'><u>Torna alle news >>></u></FONT></A>
";
};
newsBlock.prototype.show_news2 = function() {
var cnt = ref.news_content.length;
ref.textBlock_mc.news_txt.text = "";
if (!ref.sf_news) {
for (var i = 0; i<cnt; i++) {
ref.textBlock_mc.news_txt.htmlText += "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_d ate[i]+"</FONT>"+"
"+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_c ontent[i].substring(0, ref.n_symbol)+"</FONT>"+"...
<A HREF=\"asfunction:ref.show_news,"+i+"\"><FONT COLOR='#"+ref.l_color.toString(16)+"'>"+"<u>contin ua >>></u></FONT></A>
";
}
} else {
for (var i = 0; i<cnt; i++) {
ref.textBlock_mc.news_txt.htmlText += "<FONT COLOR='#"+ref.d_color.toString(16)+"'>"+ref.news_d ate[i]+"</FONT>"+"
"+"<FONT COLOR='#"+ref.t_color.toString(16)+"'>"+ref.news_c ontent[i]+"<FONT COLOR='#"+ref.l_color.toString(16)+"'></FONT>
";
}
}
};
![]()
![]()
![]()