Domanda

I want to separate the assets from my project. So I created a project called - Styles. The style lib is separated by folders. Each folder contains the assets for a different look of the application depending on the company that will use it.

There is a CSS for each company. Basically each CSS has the same stylenames but pointing to different asset location.

Everything works great when the Styles project is linked to the project as a source path.

Once I build the styles lib, add it to the project and remove the source path it starts giving me this - cannot resolve - error for each asset.

What is the difference in the path of an asset inside an SWC? The CSS file is contained inside the same SWC. Why it recognizes the path when the project is compiled as a folder for the project, but does not once the Styles lib is used.

È stato utile?

Soluzione

You have to add assets in swc and add path info in catalog.xml(in swc). In Flash Builder you can easily do it. I assume you create flex lib project for your assets

  • open project->properties->build path
  • add your assets folder to "source path" ( so you can see your asset folder in list which in assets tab)
  • open assets tab and choose your asset folder
  • build your project

after this operation you can open swc with winrar or any package reader to check your assets and catalog.xml there will be an elements in catalog.xml like

<file path="default.png" mod="1378205812486"/>

you have to use this path to load or embed your asset.

- old conversation

ok i missed the "cannot resolve" error. looks like you are embedding assets.it is not working because of your embedding codes are out of swc lib. swc lib is a package which keeps your actionscript classes to let you reach from main project not for the assets or other file types. but if you add all assets as class into that swc you can reach them from your project and you can easily make it with [Embed] tag.but this way css files are being useless. if you have path like this resources/img.png in your css it will always look for resources folder near swf. and this is normal it cant find the assets from swc if swc has no path info for external files

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top