Try removing the parentheses around "(i < container.numChildren)"... Just a wild guess.
There is indeed a workaround. Like the compiler is telling you, try surrounding your code with a CDATA block:
/* your code here */
The "<![CDATA[" worked.
Thanks for the help.
Sorry for being the idiot.
Oh not at all--I think in general, useful compiler error messages are so
rare, it's no wonder you missed it when one was presented.
Incidentally, what was happening is that mxml, is, after all, xml, and you
can't just have random less-than characters in your XML document, since '<'
has a special meaning (the start of a new element). You can either use an
xml entity escape ("<") or "quote" the entire <mx:Script/> section by
wrapping the entire thing in a CDATA block. The CDATA block tells the XML
processor to take everyting between "<![CDATA[" and "]]>", and forget that
it's in an XML document--just treat it like regular text. By the way, this
means that you can't have a variable like
private var cdataEnd:String = "]]>";
in your CDATA section, since the parser will assume the ']]>' signifies the
end of the script section, and will stop processing the block there.