Embedding programmatic skins in CSS and compiling to SWF

提问:

I am experimenting with using external CSS files compiled as SWF. However, I have a problem.

My css files use programmatic skins, and FlexBuilder cannot resolve the class references.
So if I have border-skin: ClassReference("com.border.SimpleGradientBorder");
it will choke when trying to build the swf because it doesn't know how to find it.
Obviously this works fine when compiled into the application, since my project properties resolves the above path.

Is there a way to embed the above class, and if so what is the syntax?


解答:

You may need to just move your CSS file into the root level of your source. I think I recall having the same problem with path resolution, and that solved it. Your code appears to be correct.


Good on you for compiling a separate swf, because if you actually start referencing embedded graphics and programmatic skins in your app, you'll be compiling them every single time you build, which will make your build slower.... and slower....... and slower.....

 

原文摘自:http://www.actionscript.org/forums/showthread.php3?t=181187

posted @ 2009-12-13 13:43  静候良机  阅读(741)  评论(0编辑  收藏  举报