If you google for a hex editor you can view swf and you can alter the header manually even, it's perfectly possible.
https://mh-nexus.de/en/hxd/you will see if you open a swf that has no compression that the first three letters give or take a letter are "swf", this is part of the swf header information.
https://github.com/HaxeFoundation/ocamllibs/blob/39f1f79b52fbc02d3b89cda6cad4f08dd88b849a/swflib/swf.ml#L262I used to use [("stuff")] in my as3 to hide code from the flash compiler so that I could use new Flash IDE with new players without having to upgrade my flash, as often the player was launched before the IDE and just edit the swf header version in byte code editor for the feature to work.
Changing a header probably won't change the file length and checks involved, so you can literally create your own code to extract the header and then write it back to the front of the bytes/string. For more complex stuff you might need to use more of the format library swf stuff to read and write stuff. you might also want to look at swfmill, I have moved Jan's work from googlecode to my github because he seemed to have stopped working with Haxe but there is quite a lot of reading and writting swf stuff in there largely based on the format library that is interesting to play with.