PDA

View Full Version : Unload dynamic textfields


yougart
08-23-2005, 06:04 AM
Hi, I use PHP to get my information from the mySQL database that I use with my flash files. Now I have some problems.

1)
On one of my pages I display a presentation on 2 members and then I have to press next page to get 2 new member presentations. On the last member, if the total number of members is odd. The last informations stays in the dynamicfield from the page before. Is it possible to empty the dynamictextfields when I press next page? I want the last field empty if there's no member to display.

2)
When I try the page in Firefox or Mozilla the next button doesn't work. The browsers don't stop loading the first two members. (It works in Internet Explorer).
This is the code:

var c = new LoadVars();
c.count = 1;
c.sendAndLoad("flash_boardroom.php",c,"POST");
c.onLoad = showContent;

function showContent(){
myData = new LoadVars();
myData.onLoad = function(success){
if(success){
for (var i = 1; i<3; i++) {
_root["namn"+i].htmlText = this["namn"+i];
_root["tele"+i].htmlText = this["tele"+i];
_root["mail"+i].htmlText = this["mail"+i];
_root["info"+i].htmlText = this["info"+i];
_root["mc"+i].loadMovie(this["bild"+i]);
}
}else trace("Error loading data")

}
//now load script
myData.load("flash_boardroom.php");
}


And here's the code for the next page

on(release){
c.count = c.count+2;
c.sendAndLoad("flash_boardroom.php",c,"POST");
c.onLoad = showContent;
}


Please fell free to comment my code! Is this the best way to do this?