Posted on Sunday 29 October 2006
I had noticed some weird behavior with the Simulate Download mode of the Flash IDE test player, but I had failed to track down the issue earlier. The issue is that static vars aren't reset when Simulate Download mode is selected: they keep their values from the previous regular test mode. To see the bug in question, write the following code in the first frame of a movie:
trace(Object.myVar);
Object.myVar = "Something";
Test the movie, you should see undefined in the output window. Now choose View > Simulate Download. You should see "Something" in the trace window, which means the static var didn't lose its value. As you can imagine this oversight will wreak havoc with anything that tests against a static var's definition: in particular, Singletons are likely to break. Fixed in Flash 9?


