mrg1982
10-13-2005, 11:38 AM
Hi again all:D
Ive tried searching for a tutorial of previous post for a while now, but no luck. This relates to a previous post of mine with shared objects, basically my problem was trying to store peoples stats to the one file name but it kept overwriting. So it was suggested to use an array but Ive had trouble with that.
What Ive done now is made a simple counter and when someone clicks on a button the counter increases in one increment.
Using this i manage to store my results as (on clicking a button)
on (press) {
_global.i++;
this["results"+i] = SharedObject.getLocal("results", "/");
this["results"+i].data.stats = username_txt"+"userscore_txt;
this["results"+i].flush();
}
Then they click another button to see all the results, this takes them to a new scene. Now on this scene I placed that scrollpane on my stage and made a new movie called it "userranks" such that this is what will be shown in the scrollpane. And I made a button with this code to that creates new textfields for the number of scores stored and displays them like this;
on (press) {
this["results"+i] = SharedObject.getLocal("results", "/");
this.userranks.createTextField("Score"+i, i, 200, 10+i, 100, 100);
userranks.this["Score"+i] = this["results"+i].data.stats;
}
Only thing is I thought what I was doing was right, it seemed to make sense, but nothing appears on the new scene.:eek:
Please can someone tell me what im doing wrong, once I get this my project is finished.
Thanks agian:D
Ive tried searching for a tutorial of previous post for a while now, but no luck. This relates to a previous post of mine with shared objects, basically my problem was trying to store peoples stats to the one file name but it kept overwriting. So it was suggested to use an array but Ive had trouble with that.
What Ive done now is made a simple counter and when someone clicks on a button the counter increases in one increment.
Using this i manage to store my results as (on clicking a button)
on (press) {
_global.i++;
this["results"+i] = SharedObject.getLocal("results", "/");
this["results"+i].data.stats = username_txt"+"userscore_txt;
this["results"+i].flush();
}
Then they click another button to see all the results, this takes them to a new scene. Now on this scene I placed that scrollpane on my stage and made a new movie called it "userranks" such that this is what will be shown in the scrollpane. And I made a button with this code to that creates new textfields for the number of scores stored and displays them like this;
on (press) {
this["results"+i] = SharedObject.getLocal("results", "/");
this.userranks.createTextField("Score"+i, i, 200, 10+i, 100, 100);
userranks.this["Score"+i] = this["results"+i].data.stats;
}
Only thing is I thought what I was doing was right, it seemed to make sense, but nothing appears on the new scene.:eek:
Please can someone tell me what im doing wrong, once I get this my project is finished.
Thanks agian:D