I write a JSFL script, have a very long loop, when this script is running, I can't stop it. only using the Alt-F4 to kill the Flash CS5, then restart it. this is too crazy. How can I stop the JSFL script without kill the Flash?
Asked
Active
Viewed 1,118 times
2 Answers
4
Here's a better approach: inside your loops, put a condition to check if a key was pressed. If the key was pressed, break the loop.
if(fl.tools.shiftIsDown)
{
stopScript = true;
return;
}
I used the "stopScript" var because I needed to break more then one loop to stop the script. Good luck!

femircea
- 41
- 3
0
There are a few advices:
- Optimize your script.
- Limit input
- Divide script logic into functional chunks that you can call them in a row every EnterFrame event. You can embed that script info WindowsSWF and use it's as EnterFrame event beacon (every frame WindowSWF panel calls a function in JSFL). You can add a button in a panel that stops calling JSFL function every frame.

Rytis Alekna
- 1,387
- 7
- 17