AS3转码器模仿类型 [英] as3 transcoder mimetypes

查看:85
本文介绍了AS3转码器模仿类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用

[Embed(source = 'mystyle.css', mimeType = 'text/css')]
private var _css:Class;

,但是'text/css'不是受支持的代码转换器.是否有某人可以指向我的转码器列表?

but 'text/css' is not a supported transcoder. Is there a list of transcoders that someone can point me to?

我真的只需要它来阅读纯文本,但是'text/plain'也不可用.欺骗as3来做真正简单的事情的任何其他方式都值得赞赏.

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.

推荐答案

据我所知,AS3/Flash支持的MIME类型与Flex支持的相同. Flex支持:

As far as I'm aware, the MIME types supported in AS3/Flash are the same as those supported in Flex. Flex supports:

  • 应用程序/八位字节流
  • 应用程序/x字体
  • application/x-font-truetype
  • application/x-shockwave-flash
  • 音频/mpeg
  • 图片/gif
  • 图片/jpeg
  • image/png
  • 图片/svg
  • image/svg-xml
  • application/octet-stream
  • application/x-font
  • application/x-font-truetype
  • application/x-shockwave-flash
  • audio/mpeg
  • image/gif
  • image/jpeg
  • image/png
  • image/svg
  • image/svg-xml

可以在此处找到更多信息

这些MIME类型不特别支持的任何内容都应使用"application/octet-stream".该文件作为ByteArray对象嵌入,因此您将需要弄清楚如何自己解析它,尽管CSS作为纯文本格式将非常简单.根据您使用的CSS属性,您甚至可以使用 StyleSheet类.

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.

这篇关于AS3转码器模仿类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆