Flash 8 bug: undead static vars wreak havoc in Simulate Download mode

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?


WordPress database error: [Can't open file: 'wp_comments.MYD'. (errno: 145)]
SELECT * FROM wp_comments WHERE comment_post_ID = '217' AND comment_approved = '1' ORDER BY comment_date

No comments have been added to this post yet.

Leave a comment




Your e-mail address is never displayed. If you run into issues with SpamKarma blocking you, email me at $patrick->5etdemi(com)


RSS feed for comments on this post | TrackBack URI