Hi Carlos,
I’m glad you are having this problem ☺ ... don’t get me wrong, but it points
out a problem I noticed when working on cleaning up the MXMLFlexJSPublisher.
The problem is that only png, gif, jpg and json resources are copied. This is
hard coded and I don’t like that approach. I would prefer something more Maven
style in which you have sources and resources.
This way everything in the resources could be copied instead of this hack with
hard-coded filters. A short fix would be to name your image „jpg“ instead of
„jpeg“.
The second thing is the „relativity to the main class“. It seems all resources
are addressed relative to the main class:
File imageSrcDir = new
File(configuration.getTargetFile()).getAbsoluteFile().getParentFile();
This sort of works as long as the Main class is in the root of the project.
This restriction however only seems to apply if you are using Flash Builder. In
my IntelliJ and Maven applications I usually put my Main classes in packages.
You can have a look at the code I’m talking about in MXMLFlexJSPublisher (Lines
177-201 in my closure-classpath-sources branch or 149-152,407-421 in the
develop branch)
Chris
Am 03.11.16, 23:10 schrieb "[email protected] im Auftrag von Carlos
Rovira" <[email protected] im Auftrag von [email protected]>:
Hi Chris,
I'm trying to test a simple <js:Image> in MDLExample without luck,
something like:
<js:Image url="main/resources/Unknown.jpeg" width="220" height="140"/>
is not working.
I think the problem is maven is not copying the image asset to to target
folder.
I get it working with something like this:
<js:Image url="../../../../src/main/resources/Unknown.jpeg" width="220"
height="140"/>
(reaching it from outside target and from the source project)
Maybe I'm doing something wrong?
--
Carlos Rovira
http://about.me/carlosrovira