I'm loading an swf file into my main application using URLLoader, I want to get the background color of the loaded swf file. ( I heard that one solution wold be reading the byte code of the loaded swf )
R – How to get the background color of a loaded swf file
actionscriptactionscript-3flashloader
Best Answer
Yes, You need to look into binary swf data. Here is brief description of swf format. And this is a little detail about different kind of tags. Your requirement is to find out SetBackgroundColor tag(tag type = 9), which commonly is either first or second tag of the swf.
Bytes in swf file follows little endian order, so you need to be careful while reading the data. And mostly they will be compressed(first three bytes will be "CWS") so from 9th bytes onwards (including 9th), all data needs to be decompressed (ByteArray.decompress) before processing.
SomeExample code :)