Saturday, March 8, 2008

Unable to resolve '[file]' for transcoding

So I was happy building my project in Flex Builder, till I committed my code and CruiseControl complained that I cannot build it ! See, CC uses compc (the command line compiler) to compile the module and it was returning:

unable to resolve 'assets/cross_cursor.png' for transcoding.

Here is what the code looked liked.


So I said to my self, "Oh come on! I thought you can handle pngs. Poop !" - Googled the error and found this link. And the solution was to add a "/" in front of "assets":


Now I'm happier :-)


Ned said...

Do you have any idea how to fix this problem for fonts?

I am trying to embed a font as such:

fontFamily: "Century Gothic";
fontWeight: lighter;
fontStyle: normal;
src: url("/assets/gothic.ttf");

I have placed the gothic.ttf TrueType font file in assets and I always get the error. Any ideas?

Thank you.

Dzioker said...

Hi Ned,

If you haven't found this solution already, you just need to add

-managers flash.fonts.AFEFontManager

To the "Additional Compiler Arguments" in the properties of the project.

Jobin Basani said...

Was wondering what caused the error!

Lanny said...

Thanks for your post. It resolved my issue, but for some reason it was only necessary on some files. Others worked fine without the preceding slash.


Nadia said...

i tried to resolve this problem by adding '/' at the fornt but didnot work. The solution i found is to add two dots and slash. e.g

ThunderHead said...

Thanks for sharing

Tyler Arehart said...

I had this problem with @Embed('../img/check.png'), and I changed it to @Embed('/../img/check.png') and it works. Thanks for posting!

Note for the search engines, I came across this when trying to generate ASDoc.

@SeasideVenturaCA said...

This problem is driving me crazy...I've tried all of the above to add a static legend png to a CreatePDF widget in the SFV and nothing works...I still get this error message

var pngBytes:Class;

myPDF.addImageStream( new pngBytes() as ByteArray, 0, 0, 0, 0, 1, "false");


John said...

That's the answer that I'm finding all over the internet, but I can't seem to get it to work. I must be doing something else wrong. I just started using FlashDevelop for the first time today, and I'm using the FlashPunk engine with it. Here's my code:

import net.flashpunk.Entity;

public class MyEntity extends Entity
private var PLAYER:Class;

public function MyEntity()
graphic = new Image(PLAYER);

override public function update():void
trace("MyEntity updates.");

Any ideas?

ThunderHead said...

hum - not sure - maybe SDK version ? I'm using Flex 4.1

Aneesh said...

I found a workaround for this problem:

It could be a JDK problem.