Strange behaviors those metadata tags can have…
If you don’t know what you can do with metadata tags in your AS3 code, check this link, it will explain all the very useful things you can do with them.
So I had a couple of metadata tags in my code. When I would compile with Flash CS5.5, everything would work as expected: all my metadata tags and their arguments would be accessible at runtime.
But then I tried to compile the same exact code with the Flex or AIR sdk (latest) and, oh surprise, only a couple of my tags would remain… only the ones with no arguments specified…
Strange isn’t it ? well to make a story that is already short even shorter, it happens that when using the Flex or AIR sdk, if any of the values of a metadata tag argument contains a “-” (minus) sign and that it is not in between ” or ‘, it will simply be avoided by the compiler.
Hope it helped someone else than me as I couldn’t find anything about that anywhere on the web… I “almost” filled a bug at adobe bug base 🙂
*And for those who are really new to metadata tags, don’t forget to tell the compiler to keep them, using the -keep-as3-metadata+=YOUR_TAG_NAME as a compiler option.
(“+=” is really important to keep the other tags, unless you want to be sure only the tag you want is being compiled, thanks Scott Enders for the correction)