ciao ragazzi..vorrei sapere come far aprire un file pdf al click sulla news che scorre...
File XML
<?php
session_start();
require("../common/funzioni.php");
$res_news=dbquery("SELECT * FROM news ORDER BY data DESC ");
header("Content-type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8" ?> '."\n";
echo '<messaggi>'."\n";
while ($news=mysql_fetch_array($res_news)) {
echo '<url>http://....../$news['allegato_eng']</url>
<testo><![CDATA['.convertiData($news['data']).' - '.stripslashes($news['descrizione_eng']).']]></testo>'."\n";
}
echo '</messaggi>'."\n";
?>
ACTION SCRIPT
function loadXML()
{
function ElaboraXML(success)
{
if (datiXML.loaded)
{
contenuto = datiXML.firstChild;
i = 0;
node = contenuto.firstChild;
while (node != null)
{
j = 0;
for (childNode = node.firstChild; childNode != null; childNode = childNode.nextSibling)
{
trace (childNode.nodeValue);
text.testo.htmlText = text.testo.htmlText + childNode.nodeValue;
text.testo.htmlText = text.testo.htmlText + " ";
++j;
} // end of for
trace (text.testo._width);
text.testo.autoSize = true;
node = node.nextSibling;
++i;
} // end while
text._x = -text._width;
muovi();
} // end if
} // End of the function
unico = new Date().getTime();
datiXML = new XML();
datiXML.ignoreWhite = true;
datiXML.onLoad = ElaboraXML;
datiXML.load("../xml/news_eng.php");
} // End of the function
function muovi()
{
this.onEnterFrame = function ()
{
if (text._x < -text._width)
{
text._x = 630;
} // end if
text._x = text._x - 2;
};
} // End of the function
function ferma()
{
delete this.onEnterFrame;
} // End of the function
loadXML();

Rispondi quotando