I'm not sure from your description what your problem might actually be. It sounds like most everything should work...
I would, however, not use the createMovie/removeMovie code you're using for the submit score function.
Just take the line
NonobaAPI.SubmitScore("myscore1", score, highscore_callback);
and put it on the third frame outside of an enterFrame, like you would when declaring a variable.
That may or may not actually solve your problem, it's hard to say.
Contestar al tema
Regístrate ahora para responder a éste tema
Creampie dijo
hace mucho tiempo | Publicación #1Basic layout of my Flash:
Frame 1: Title Screen
Frame 2: Game
Frame 3: Ending screen with score
On Frame 3, I have the following code. I'm sure theres a far better way of doing this, but basically I have it set so when the Flash reaches frame 3, it executes the NonobaAPI code and sends the high score.
_root.createEmptyMovieClip("watcher", _root.getNextHighestDepth());
_root.watcher.onEnterFrame = function() {
if (currentFrame == 3) {
NonobaAPI.SubmitScore("myscore1", score, highscore_callback);
_root.watcher.removeMovieClip();
}
}
Frame 2 has this code (I'm attempting to reset the score..):
score=0;
The Problem:
When I play the game the 1st time, it works and submits the score.
When I press the 'Play Again' button (which just sends you back to Frame 2 to play again), it works fine on the 2nd time and submits the score.
The 3rd time I try and play it though, it won't submit the score. I have to refresh the page and play again in order to submit any scores.
How can I truly reset the game score when moving back to another frame?
Thanks :)