Flash Weirdness of the Day (FlashWoD)

Posted: April 8, 2011 in Uncategorized

I spent some significant time trying to hunt down a bug (or maybe heisenbug), on and off for the last week. Thought I’d nailed it last night, but it was back again this morning.

This is in our pure actionscript 3 game that we’re developing.
It was a crash to do with a null being dereferenced, which was traceable back to a flashvar that is passed into the SWF randomly getting lower-cased by unknown forces. This flashvar is supposed to be a case-sensitive string ID, so when it got lowercased, the thing it was supposed to refer to didn’t match it any more.

In the end, it all came down to firebug. If I hit refresh in Firefox normally, everything worked properly. However, if I opened firebug and then refreshed, the flashvar will be magically lowercased before being handed to the SWF. Putting a trace at the top of the main stage owner sprite like so:

trace("Flash var: " + embedded_variables.assume_stage);

Would normally reveal:

But opening firebug and refreshing again gives:
Flash var: my_case_sensitive_identifier

At all times, the flashvar in the DOM (as revealed by Firebug) was unchanged and correct.

So, I added a call in actionscript to explicitly uppercase that flashvar so that we don’t crash with firebug.

Inexplicable. I don’t really know what to blame here: firebug, flash or firefox. I’m tempted to blame Flash though, which seems to infect everything it touches with Adobe’s personal brand of crazy.

  1. I think that’s one of the rare cases where it probably _isn’t_ Flash’s fault. 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s