I teach games development using Flash Professional CS6, and one of my students has photosensitive epilepsy. He is finding that the 'strobing' effect which occurs when he executes Test Movie on a movie with errors in its script is triggering headaches which can be a precursor to a fit. Obviously this is making it very difficult for him to complete his lab and assignment work. Is there any way of preventing a Flash movie from running if it contains a syntax error?
I have created a workaround by adding a bunch of extra frames to the start of the movie which will display a "SYNTAX ERROR" message if the script doesn't run - this gives my student a few seconds margin to quite the movie before the strobing begins. I have a single frame at the start with a goto statement which jumps over those error frames if the code doesn't have any syntax errors.
This seems to be working ok, but it's an ugly solution - does anyone know of a better way to deal with this?
unfortunately, there's no better way to do that. this is an excerpt from a book i wrote:
Compile-time errors prevent all code, no matter where it is located, from executing. You will see your main timeline play (along with any MovieClips) from start to finish and then loop. It usually looks like a headache-inducing mess. If you are prone to seizures, click the close button on your test movie panel as soon as possible.
You do not need to read the error message(s) before closing the test movie panel. The error message(s) will remain in the Compiler Error panel where you can read at your leisure long before you suffer a migraine or grand mal seizure
1.In Preferences you can check "open test-movie in tabs".
2. Having done that you could write a jsfl-script which switches the focus (immeadiately after you test the movie) to another tab in the same register card, thus, forcing the possible "corrupt" testmovie in the background. If are no compiler errors , the testmovie can be made available by simply switching to the test-movie tab, if there are compiler errors, you can close it without having to look at it.
Another option would be to setup FlashDevelop as compiler trigger of Flash.
You have to change these basic properties in your project:
FlashDevelop will only launch the test movie if it compiles flawless, inside Flash.
FlashDevelop will act as a "bouncer" to Flash.
Another solution is to use Flash Builder (IMO you should already be teaching this workflow, as it is the one most suited to nontrivial projects), and then you have several options:
All of these options will simply build the Flash movie without playing it, and you can see the warnings/errors in the appropriate panel before clicking the Play or Debug button.
If all of this is just too much for a beginner student, you can always Publish the movie, which creates the swf without playing it, look at the Warnings/errors panel, and then launch the swf some other way (such as double-clicking it or the generated HTML page).
Thanks everyone for your replies. As we've got halfway through the course before becoming aware of this issue and the students are relative novices switching to alternative IDE is probably going to cause further problems.
Amy's solution of using Publish to test for errors first is exactly the sort of simple change that I was hoping someone would identify - I'll pass this on to the student.