SWC and embedable assets

3 views
Skip to first unread message

leif

unread,
May 23, 2008, 9:18:13 AM5/23/08
to Israfil Mojo User Discussions
I haven't setup a new project in a while and I seem to have lost all
prior knowledge to Israfil and Flex :)
My problem is that I can't get a SWC project to compile because it can
not find resources I have references using @Embed. I get the following
error:
SiteDialog.mxml(139): Error: unable to resolve 'assets/text-
banner.png'
<mx:Image id="fbPreview" source="@Embed('assets/text-banner.png')" /
>

All my assets are in a folder 'assets' in src/main/resources (I have
also tried this with the resource located in /src/main/flex/).
Here is the build part of my pom:
<build>
<plugins>
<plugin>
<groupId>net.israfil.mojo</groupId>
<artifactId>maven-flex2-plugin</artifactId>
<version>1.3</version>
<extensions>true</extensions>
<configuration>
<flexHome>${flex.home}</flexHome>
<useNetwork>true</useNetwork>
<main>ApplicationContainer.mxml</main>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources/</directory>
</resource>
</resources>
</build>

D. Alexeev

unread,
May 24, 2008, 6:39:55 AM5/24/08
to Israfil Mojo User Discussions
Hi,

I successfully resolved a similar problem by switching to the absolute
path notation.

Try @Embed('/assets/text-banner.png') instead of @Embed('assets/text-
banner.png')

There are some strange differences between internal FlexBuilder
compiling and mxmlc.

Grüße,
Alexeev

leif

unread,
May 26, 2008, 3:13:51 AM5/26/08
to Israfil Mojo User Discussions
Thanks Alexeev, that solved the issue.

On May 24, 12:39 pm, "D. Alexeev" <dimitri.alex...@googlemail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages