如何将CSS文件动态加载到Flex应用程序中?

编程入门 行业动态 更新时间:2024-10-28 18:25:25
本文介绍了如何将CSS文件动态加载到Flex应用程序中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我知道你可以应用CSS为了使用StyleManager对Flex中的对象进行样式化: livedocs.adobe/flex/3/html/help.html?content=styles_07.html

I know that you can apply CSS in order to style objects in Flex using the StyleManager: livedocs.adobe/flex/3/html/help.html?content=styles_07.html

您也可以动态加载编译的 CSS文件(SWF): livedocs.adobe/flex/3/html/help.html?content=styles_10.html

You can also load compiled CSS files (SWFs) dynamically: livedocs.adobe/flex/3/html/help.html?content=styles_10.html

但是,我使用Web GUI和服务器端脚本动态创建我的CSS文件。 如果CSS被改变,那么脚本也需要将CSS编译成SWF(这不是一个可行的选项)。有什么办法解决这个问题吗?

However, I'm dynamically creating my CSS files using a web GUI and a server-side script. If the CSS is changed, then the script would also need to compile the CSS into an SWF (which is not a viable option). Is there any way around this?

推荐答案

Flex中的应用程序在服务器端在编译时处理,而不是在

The application of CSS in Flex is handled on the server side at compilation and not on the client side at run time.

我会看到两个选项(我不知道这是多么实用):

I would see two options then for you (I'm not sure how practical either are):

  • 使用服务器端脚本将CSS编译为SWF,然后动态加载它们。
  • 解析CSS样式表并使用setStyle函数在flex中应用样式。此方法的一个类似示例是 Flex Style Explorer ,您可以在其中请查看来源。
  • Use a server side script to compile your CSS as a SWF then load them dynamically.
  • Parse a CSS Style sheet and use the setStyle functions in flex to apply the styles. An similar example to this approach is the Flex Style Explorer where you can check out the source.
  • 祝你好运。

    更多推荐

    如何将CSS文件动态加载到Flex应用程序中?

    本文发布于:2023-07-23 09:34:01,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1195988.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何将   应用程序   加载   文件   动态

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!