在 Actionscript 3 项目中显示 HTML
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/260270/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Display HTML in an Actionscript 3 project
提问by
Folks,
各位,
I am pulling all my Flash (pure AS3 project, not Flash CS3) content from a Drupal back-end for SEO purposes. This works great, except the HTML rendering built into the TextField object leaves a lot to be desired. Could anyone recommend any libraries that would allow me to display HTML elements? At this stage, commercial or open-source libraries are welcome.
我正在从 Drupal 后端提取我所有的 Flash(纯 AS3 项目,而不是 Flash CS3)内容用于 SEO 目的。这很好用,除了 TextField 对象中内置的 HTML 呈现还有很多不足之处。任何人都可以推荐任何允许我显示 HTML 元素的库吗?在这个阶段,欢迎商业或开源库。
Thanks, Marcus
谢谢,马库斯
回答by jdoklovic
you might also want to try: http://code.google.com/p/htmlwrapper/
您可能还想尝试:http: //code.google.com/p/htmlwrapper/
I haven't used it but it looks like it does what you want.
我还没有使用它,但它看起来像你想要的那样。
回答by aaaidan
AIR introduces a DisplayObject
called flash.html.HTMLLoader
. It's powered by WebKit, so if your content is compatible with Safari, it will work with HTMLLoader
.
AIR 引入了一个DisplayObject
名为flash.html.HTMLLoader
. 它由 WebKit 提供支持,因此如果您的内容与 Safari 兼容,它将与HTMLLoader
.
回答by Yaba
There is an Flex HTML componentavailable that's pretty good. It uses the browser to render the contents.
有一个非常好的Flex HTML 组件可用。它使用浏览器来呈现内容。
However it's not free. You will have to invest $149.
然而它不是免费的。您将需要投资 149 美元。
You can test the capabilities of this component here.
您可以在此处测试此组件的功能。
回答by Andrew
2Synthmax http://as3htmlparser.sourceforge.net/
2Synthmax http://as3htmlparser.sourceforge.net/
回答by Matt W
So long as your project is viewed within a web browser, your best bet would be to overlay HTML content in a DIV or iFrame above the Flash content using a JavaScript tool such as JQery's ThickBox
只要您的项目是在 Web 浏览器中查看的,最好的办法就是使用 JavaScript 工具(例如JQery 的 ThickBox)在 Flash 内容上方的 DIV 或 iFrame 中覆盖 HTML 内容
回答by Matt W
You could try out this AS3 HTML Parser Library... works well for my needs, It currently supports most elements (including img, span, div).
你可以试试这个AS3 HTML 解析器库……很适合我的需要,它目前支持大多数元素(包括 img、span、div)。
回答by Scott Evernden
Does your swf need to fill all of the web page? Why not have your swf call some javascript that will populate a DIV or whatever. Or just have the PHP generate that. I guess I need more information what you're trying to do...
你的 swf 需要填满整个网页吗?为什么不让您的 swf 调用一些将填充 DIV 或其他内容的 javascript。或者只是让 PHP 生成它。我想我需要更多信息,您正在尝试做什么...
回答by Randy Stegbauer
Try using this Flex iFrame, which is modeled after it's HTML iframe counterpart. I haven't used this solution in my Flex applications yet, but it looks promising.
尝试使用这个 Flex iFrame,它是在它的 HTML iframe 对应物之后建模的。我还没有在我的 Flex 应用程序中使用这个解决方案,但它看起来很有希望。
http://deitte.com/archives/2006/08/finally_updated.htm
http://deitte.com/archives/2006/08/finally_updated.htm
However, please note that this same author now recommends againstusing this.
但是,请注意,同一作者现在建议不要使用它。
As always, your mileage may vary, Randy Stegbauer
与往常一样,您的里程可能会有所不同,Randy Stegbauer