I have some problem to send data from a textfield to another textfield.
The first textfield shows the ten latest news with just the date and the headline.
In the second textfield the latest news is shown.
When you click at one of the news in the first textfield the news should appear in the second textfield with the entire text of the news.
I don’t know how I can link the news to the other textfield.
The information is stored in a database and I get the information with a phpscript to flash.
Here is my flashcode and my phpscript.
System.useCodepage = true;
arkiv.html = true;
send_l = new LoadVars();
result_l = new LoadVars();
send_l.sendAndLoad("http://**/getarkiv.php", result_l, "POST");
result_l.onLoad = function(success) {
arkiv.html = true;
if (success) {
for (i = 0; i < result_l.newsCount; i++) {
arkiv.htmlText += result_l['news'+i+'date']+"<br>";
arkiv.htmlText +="<b>"+result_l['news'+i+'headline']+"</b><br><br>";
}
} else {
trace("error==" + unescape(result_l));
}
};
$connection = mysql_connect(**);
mysql_select_db ('**');
$query = "SELECT * FROM news ORDER BY newId DESC LIMIT 10";
$result = mysql_query($query) or die ("error");
$newsCount = mysql_num_rows($result);
for ($count = 0; $count < $newsCount; $count++){
$news = mysql_fetch_array($result);
$newId = $news['newId'];
$date = $news['date'];
$headline = $news['headline'];
$output .= "&news" . $count . "newId=" . $newId;
$output .= "&news" . $count . "date=" . $date;
$output .= "&news" . $count . "headline=" . $headline;
}
$output .="&newsCount=".$newsCount;
echo $output;
mysql_close($connection);