简体   繁体   English

Flex中的CSS无需编译?

[英]Css in Flex without compiling?

I added an external stylesheet file (css) to my flex project. 我在我的flex项目中添加了一个外部样式表文件(css)。 Is there a possibility that the css is not compiled with the swf? CSS可能没有用swf编译吗? It would be great if I could put the swf on my webspace and afterwards only change a css file to customize my application and fit it to the colors of my homepage. 如果可以将swf放在我的网站空间上,然后只更改一个css文件来自定义我的应用程序并使它适合我的首页颜色,那将是很好的。

Thanks in advance 提前致谢

Sebastian 塞巴斯蒂安

Yes thats exaclty what happens. 是的,多数民众赞成在发生什么事。 Right click the CSS in your flex project and click 'compile to swf' then when you build your app you will see the CSS file as a SWF file in the same folder structure but in the bin-release folder. 在flex项目中的CSS上单击鼠标右键,然后单击“编译为swf”,然后在构建应用程序时,您会在相同的文件夹结构中但在bin-release文件夹中看到CSS文件为SWF文件。

So next time you update the CSS, you just upload the updated CSS-SWF file. 因此,下次您更新CSS时,只需上传更新的CSS-SWF文件。 This is providing that you load in the CSS-SWF file at runtime. 这提供了您在运行时加载CSS-SWF文件的功能。 If your app doesn't load the CSS_SWF at runtime it will still contain whatever styles it had when you built the app in the first place. 如果您的应用程序在运行时未加载CSS_SWF,则它仍将包含您最初构建应用程序时所具有的样式。

check out http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/ for more info on runtime loading of CSS. 请查看http://blog.flexexamples.com/2007/12/12/loading-cascading-style-sheets-on-the-fly-using-the-flex-stylemanager-class/了解有关CSS的运行时加载的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM