ciao
ho questo codice che mi visualizza delle news, funziona benissimo,
ora però volevo fare in modo che di trasformare i titoli in link, e cliccandoli mi
visualizzasse il relativo testo del nodo desc in una textfield,
non saprei come modificarlo
Codice PHP:
var style_Data:TextFormat = new TextFormat();
style_Data.color = 0xFF0000;
style_Data.font = "mFont";
var style_Title:TextFormat = new TextFormat();
style_Title.color = 0xFFFFFF;
style_Title.font = "mFont";
style_Title.size = 10;
var style_Desc:TextFormat = new TextFormat();
style_Desc.color = 0xFFFFFF;
style_Desc.font = "mFont";
style_Desc.size = 10;
var xObj = 0;
var yObj = 0;
var widthObj = this._parent.mask._width;
function parseXML(xmlDoc)
{
if (xmlDoc.loaded && xmlDoc.hasChildNodes)
{
var mytekst = xmlDoc.firstChild.childNodes;
for (i = 0; i < mytekst.length; i++)
{
this.createTextField("Data"+i, this.getNextHighestDepth(), xObj, yObj, widthObj, 20);
this["Data"+i].multiline = true;
this["Data"+i].wordWrap = true;
this["Data"+i].htmlText = mytekst[i].childNodes[1].firstChild.nodeValue;
this["Data"+i].embedFonts = true;
this["Data"+i].setTextFormat(style_Data);
this["Data"+i].autoSize = true;
yObj += this["Data"+i]._height;
this.createTextField("Title"+i, this.getNextHighestDepth(), xObj, yObj, widthObj, 20);
this["Title"+i].multiline = true;
this["Title"+i].wordWrap = true;
this["Title"+i].htmlText = mytekst[i].childNodes[2].firstChild.nodeValue;
this["Title"+i].embedFonts = true;
this["Title"+i].setTextFormat(style_Title);
this["Title"+i].autoSize = true;
yObj += this["Title"+i]._height;
this.createTextField("Desc"+i, this.getNextHighestDepth(), xObj, yObj, widthObj, 20);
this["Desc"+i].multiline = true;
this["Desc"+i].wordWrap = true;
this["Desc"+i].htmlText = mytekst[i].childNodes[3].firstChild.nodeValue;
this["Desc"+i].embedFonts = true;
this["Desc"+i].setTextFormat(style_Desc);
this["Desc"+i].autoSize = true;
yObj += this["Desc"+i]._height;
} // end of for
if(this._parent.mask._height > this._parent.container._height){
this._parent.arrowUp._visible = false;
this._parent.arrowDown._visible = false;
}
} // end if
delete txtXML;
} // End of the function
stop();
var txtXML = new XML();
txtXML.ignoreWhite = true;
txtXML.onLoad = function (success)
{
if (success)
{
parseXML(this);
} // end if
};
_root.pagine.container.txtXML.load("crea_xml_db.asp?rnd=\"+random(99999);");
grazie