开发者

Trouble compiling flashbuilder project with sdk 3.*

I have a series o开发者_StackOverflowf projects that we have been using Flex3/Flashbuilder to work with, but I've recently been trying to move over to Flashdevelop for most of my development but I have hit a snag with a certain project structure that Flex/FB can handle but FD/mxmlc can't with sdk 3.*

What I have is something like this:

project_root/

 /src

 /resources

The resources in flex is added as a class path to the project and I am embedding images like this: [Embed(source="/wardrobe.png")]

This all works fine in Flex/FB but FD I get there errors for all my images :

Error:unable to resolve '/wardrobe.png' for transcoding Error:unable to transcode /wardrobe.png

This problem don't occur when I'm using the Flex 4 sdk, but for these projects I require 3.2. If anyone has any idea of what these projects won't build and a way to make them work outside of Flex/FB that would be great.


Good news: there is a reason why the Flex 3 SDK does not resolve embeds in the entire classpath but only the class' one.

Bad news: it's a bug which is not going to be fixed in Flex 3 SDK (it's ok in Flex 4 SDK). As a matter of fact, both FlashBuilder and Maven Flexmojos use a workaround (they inject a custom "resource resolver" in the compiler).

Solution: The best you can do is to fix embed paths like: "/../resources/wardrobe.png" (the starting "/" makes the path relative to the class' classpath root).


try cleaning the project

i don't know where in flex builder but in eclipse it in Project>Clean

then build again the project..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜