I would like to embed a css file using
[Embed(source = 'mystyle.css', mimeType = 'text/css')]
private var _css:Class;
but ‘text/css’ is not a supported transcoder. Is there a list of transcoders that someone can point me to?
I really just need it to read plain text but ‘text/plain’ is not available either. Any other way of tricking as3 to do something really simple is appreciated.
As far as I’m aware, the MIME types supported in AS3/Flash are the same as those supported in Flex. Flex supports:
Further information can be found here.
Anything that isn’t specifically supported through these mime types should use “application/octet-stream”. The file is embedded as a ByteArray object so you’ll need to figure out how to parse it yourself, though CSS as plain text will be pretty straight forward. Depending on what CSS properties you’re using you could even use the parseCSS function of the StyleSheet class.