I'm trying complie my project via mxmlc this way:
[prj_folder]\src>mxmlc mymxml.mxml -library-path+=../libs -sp+=..\assets
and i get such errors:
[prj_folder]\src\view\controls\controlname.mxml(7): Error: Problem finding external st
ylesheet: assets/cssname.css
<fx:Style source="assets/cssname.css"/>
[prj_folder]\src\view\constants\Images.as(24): col: 3: Error: Unable to transcode assets/ icons/icon1.png.
how to include assets for the compiler?
Flash Builder preprocesses the files.
For a directory structure like this:
projectdir/src/Main.mxml
projectdir/src/views/SomeView.mxml
projectdir/src/assets/MyImage.png
And if SomeView.mxml references assets/MyImage.png, Flash Builder will allow this:
@Embed('assets/MyImage.png')
because it is preprocessed to /assets/MyImage.png by the IDE, but ant/maven + mxmlc won't do that.
@Embed('/assets/MyImage.png')
works for both Flash Builder and mxmlc.
If you are using a relative path like this:
@Embed('../assets/MyImage.png')
try changing it to this, odd as it may seem:
@Embed('/../assets/MyImage.png')
The leading / gets translated to "my src directory", and mxmlc does the remainder of the path calculation from there.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With