Hi,
I’m doing this
http://www.webmonkey.com/webmonkey/03/40/index0a.html?tw=programming tutorial for a blog in flash and I’m stuck on part of it…the end. I already wrote about this tutorial in a previous thread but I have that part figured out. This is more about the actionscript part of it…or maybe it’s the php. I’m not sure. I’m not sure what I’m doing wrong but I’m done with the tutorial and I only have one entry in my blog showing up online. I have 3 in my database. I’m wondering why I’m not seeing the archives for the others. My php is:
<?php
mysql_pconnect (“localhost”, “username”, “password”);
mysql_select_db (“blog”);
$qResult = mysql_query (“SELECT * FROM blog_entries ORDER BY id DESC”);
$nRows = mysql_num_rows($qResult);
$rString ="&n=".$nRows;
for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($qResult);
$rString .="&id".$i."=".$row[‘id’]."&"."&title".$i."=".$row[‘title’]."&"."&date".$i."=".$row[‘date’]."&"."&entry".$i."=".$row[‘entry’]."&";
}
echo $rString."&";
?>
My actionscript is:
//function to load external data using the loadVars() object
//l=name of loadVars object
//n=name of text field
//t=trigger to decide whether to show all entries or just one.
//e= entry number to display (number)
//f=file to load from (string)
function lv(l, n, t, e, f) {
sb.setSize(null, 200);
sb2.setSize(null, 50);
//create a new loadVars object if one doesn’t already exist if it does, use it
if (l == undefined) {
l = new LoadVars();
l.onLoad = function() {
var i;
//clear out any text that might already be there
n.htmlText = “”;
//to show a single entry at a time we use the following code
if (t == undefined) {
n.htmlText += “<b>”+this[“title”+e]+" - “+this[“date”+e]+”</b><br><br>";
n.htmlText += this[“entry”+e];
} else {
//cycle through and show all entries
for (i=0; i<this.n; i++) {
n.txt.htmlText += “<u><a href='asfunction:_root.loadArc,”+this[“id”+i]+"’>"+this[“title”+i]+" - “+this[“date”+i]+”</a></u><br>";
}
}
sb.update();
sb2.update();
};
}
l.load(f);
}
function loadArc(passed) {
arcNum = passed-1;
lv(blog_lv, entries_txt, undefined, arcNum, “blog.php”);
}
//for the large entry textfield
lv(blog_lv, entries_txt, undefined, 0, “blog.php”);
//for the archives text field
lv(archive_lv, archive_txt, “cycle”, null, “blog.php”);
I found another post on kirupa about this tutorial but I didn’t understand how they fixed the problem. I’d appreciate your help.
Thank you.
Holly
Holly