I’m trying to create a button (view_btn) that will load the selected item in a dataGrid - like an inbox that show the whole message once selected and view_btn is pressed.
The basic info is in one table(A) and the full info is in another table(B) in a mysql database. The two are linked by (A) having a field that equals the id number of (B).
The basic info loads ok into a dataGrid. I can delete and insert new entries into both (A) and (B) ok and they’re linking fine.
I just seem to be having trouble getting the data into flash from (B)
It also shows “hello” in msg_ta.text so i’m assuming that the connection has been made but when I - trace (view_lv.b1); - it is undefined.
i have tested the php and it works. I’m having trouble either passing the variable ‘arrange’ to the php or showing the retreived data in flash.
can anyone help please?
view_lv.onLoad = function(ok:Boolean) {
if (ok) {
if (this.errorcode=="0") {
for (var i:Number=0; i < this.n; i++) {
viewInfo.push(
{jingleID:this["id"+i],
dater:this["date"+i],
b1:this["b1"+i],
b2:this["b2"+i],
b3:this["b3"+i],
b4:this["b4"+i]
});
msg_ta.text = "hello";
}
} else {
// show kind of error
msg_ta.text = errorMsgs[Number(this.errorcode)];
// if query error, show mysql_error
if (this.errorcode == "3") msg_ta.text += ": " + this.msg;
}
} else {
// if loadvars failed (eg, if script not found)
msg_ta.text = "Flash-database delete operation failed";
}
};
function viewRecord() {
viewIndex = scores_dg.selectedIndex;
var arrange:Number = scores_dg.selectedItem.arrangement;
view_lv.arrange = arrange;
view_lv.sendAndLoad(filepath+"script.php",view_lv,"GET");
//gotoAndStop('Viewer');
trace(view_lv.b1);
}
view_btn.addEventListener("click", viewRecord);
Thanks in advance