simulate
07-05-2006, 06:46 PM
Hello,
I have a two frame movie. On the first frame is a button with the code:
_parent.gotoAndStop(2);
On the second frame, I want to show iterations of a calculation as the calculation is running. Here's the code for frame 2:
stop();
calculate();
function calculate() {
for (var f = 1; f <= 30000; f++) {
resultsField.value = "Completed " + f + " of 30000 iterations.";
}
}
The problem I am having is that frame 2 doesn't show until the calculate() function is completed. So, instead of seeing the resultsField advance through the 30000 iterations, I just wait on frame 1 until the function has completed and then I see the final 30000th iteration on frame 2.
Is there a way to show the iterations on frame 2 as the iterations are taking place?
Attached is the .fla with the example.
Thanks for your help!
I have a two frame movie. On the first frame is a button with the code:
_parent.gotoAndStop(2);
On the second frame, I want to show iterations of a calculation as the calculation is running. Here's the code for frame 2:
stop();
calculate();
function calculate() {
for (var f = 1; f <= 30000; f++) {
resultsField.value = "Completed " + f + " of 30000 iterations.";
}
}
The problem I am having is that frame 2 doesn't show until the calculate() function is completed. So, instead of seeing the resultsField advance through the 30000 iterations, I just wait on frame 1 until the function has completed and then I see the final 30000th iteration on frame 2.
Is there a way to show the iterations on frame 2 as the iterations are taking place?
Attached is the .fla with the example.
Thanks for your help!