So it's deadline time again, which means - you guessed it - Flash is making my life hell again with its broken inability to do even the SIMPLEST GODDAMN THINGS.
Basically I needed to use unloadAndStop(). I had to do this because, as I've explained before, Adobe are incompetent fucks and their regular old unload() function... just doesn't. Moreover, Adobe knows about this problem but refuses to fix it - citing "compatibility". (Memo to morans: being compatible with old bugs is not some kind of virtue!) Using unloadAndStop() means you have to compile for Flash Player 10, because unloadAndStop() isn't guaranteed to be in Player 9. So I go into Project/Properties/Flex Compiler and change the minimum version to 10.0.0. Clean the workspace, and waited for it to rebuild. It doesn't rebuild successfully.
Evidently some of the code was using constructors with arguments. Which worked just fine in Flash 9, but was yanked out of Flash 10 because of... some stupid political considerations about future compatibility with ECMAScript, evidently. You go and design your language by committee, there, Adobe! That's always worked out so well! See, this is how Adobe operates. "We're going to maintain compatibility with old bugs, but we're also going to yank useful working features out of the language between versions! We wouldn't want any code you've written in the past to continue to work. We want all of your code broken. And we'll fuck you from both sides to ensure that your code either stays broken (by maintaining compatibility with old bugs), or becomes broken (by removing perfectly working features from the language)!" Fucking boneheads...
The class in question that was daring to use constructors with arguments was named big.long.packagename.Vector. So I open it up, and go and spend half a day fixing it so the constructors don't take arguments. Then I spent another half day fixing all the references in other code. You know, taking a perfectly good line like: "var myDist:Vector = new Vector(point1, point2);" and replacing it with obnoxiously verbose, failtacular crap like: "var myDist:Vector = new Vector(); myDist.makeFromPoints(point1, point2);"
So now everything compiles with no problem. But when I actually try it, it throws a run-time error:
Error #1007: Instantiation attempted on a non-constructor (at line NNN)
The code on line NNN reads:
var deltaVec:Vector = new Vector();
The constructor declaration in Vector.as is:
public function Vector()
Let's stop right here and reflect upon the magnitude of failure we're witnessing. Adobe is so utterly fucking incompetent that their runtime can't even instantiate an object correctly.
This isn't programmer error. There's nothing wrong with that constructor decl. The compiler is being run with maximum warnings, and isn't complaining about anything. (Oh, it certainly *should* be complaining about an ambiguity around big.long.packagename.Vector, but since when has Adobe been able to make a compiler that didn't shit all over itself??) No, this is pure Adobe fuck-tardery, written in mile-high blazing letters all across the heavens, like a fucking nuclear armageddon.
You see, I already know what's going on. I've worked with Adobe products long enough now that I know that Adobe is more than stupid enough to pollute namespaces. Their runtime is absolutely going to confuse my big.long.packagename.Vector with the built-in top-level Flash 10 "Vector" class - even though the two are NOTHING alike. They don't even live in the same goddamn namespace, for fuck's sake!
You want proof of my assertion?
I change the name of the class from "Vector" to "Wector".¹ And thank god for Eclipse, it quickly runs through the code and changes all the appropriate occurrences of "Vector" to "Wector" for me, so I don't need to waste half a day doing it myself. I clean the workspace, and let the auto-build do its thing...
NOW EVERYTHING RUNS PERFECTLY.
¹ Walter Koenig surrenders.
"Pulling teeth" and "kicking dead whales down the beach" doesn't even begin to describe what working with Flash is like. Making even the simplest fucking thing work on this platform is like stabbing myself in the balls with a rusty, jagged butter knife while ten thousand yowling cats scream in my ears.
Above all: I am so sick and fucking tired of being Adobe's janitor. I don't complain about shitty compilers and platforms when they're free - I believe that you often do get what you pay for. But this stuff is not free. My Flex Developer plugin license was fucking $600!! CS4 is like $1200! Truly, Adobe is the new MicroSoft. They develop shit-quality products, sell them at 1000 percent profit, and yet every stupid fool and their mom are lining up around the block to suck their dick 24/7.
The success of Adobe as a company is proof that Jesus died in vain.