Everything was working great, untill I wanted to use the [embed] code.
At work there's no problem with it, but here at home it just didn't work. And I was sure that I dit the same thing... here is what I did,
[Embed(source="../images/425400.png")]
protected var myImage:Class;
The compiler gave me this error: Error: Unable to transcode ../images/425400.png.
So, I thought to put the image in the /bin directory. not working either.
[Embed(source="425400.png")]
protected var myImage:Class;
after some searching on the internet, days of waiting and thinking... the solution was way to simple:
[Embed(source="/../images/425400.png")]
protected var myImage:Class;
put a '/' before you're path and it works..
30 comments:
Thanks a lot. You saved me a lot of time!
Same for me!
Me also!
this is the only way of getting paths to work in both Flex & Flashdevelop.
Flex automatically resolves the path, Flashdevelop doesn't - it looks for the embeded files relative from the source file location.
Worked like a charm!
these kind of thing are very annoying to debug, thanks for the info!
thanks a LOT!
Thanks!
i really thanks for you
Thanks a lot, I had no idea how to handle this!
thanks a million times!
Thanks!!! :D
thanks a lot.. :D
Thanks dude.. you saved me!
A couple of years later, and you're still helping people :D You saved me some frustration, thanks a lot!
this ismy code, but i still get error
You just saved me few hours of searching, thanks!!!
thanks a lot, it's very helpfull!!!
Works great, thank you very much!
Strange; when I add the "/" in Flash Builder and then go to Flash CS5.5 to export a swc that was complaining about the transcoding error, I get a new error complaining that the feature I'm trying to use requires updating the Flex SDK. WTF?? But other images have worked. The only difference in this PNG was I exported it from Flash. Ideas?
thanks man ! searching for this :)
+1
Like
etc :)
Much much thanks
d(*u*)b
Hi,
I am using flashdevelop 4 to compile some samples from away3D, Advanced_ShallowWaterDemo.as in particular. Since the SimpleGUI package by Justin Windle (uk.co.soulwire.gui) is part of it's dependencies/imports, which in his case is using yours (com.bit101.components)
However I get the following errors and I can't seem to get around the embedding error:
Bit101\com\bit101\components\Component.as(54): col: 3: Error: unable to resolve '../../../../assets/pf_ronda_seven.swf' for transcoding
[Embed(source="../../../../assets/pf_ronda_seven.swf", symbol="PF Ronda Seven")]
Bit101\com\bit101\components\Component.as(54): col: 3: Error: Unable to transcode ../../../../assets/pf_ronda_seven.swf.
^
Any idea's how to get around this?
I found it. Path is different in flash develop as it is in flex. Should be:
[Embed(source="../../../assets/pf_ronda_seven.swf", symbol="PF Ronda Seven")]
2013 and I'm here with the same problem. You helped me out, thanks for that.
thanks man, really appreciate you posting this!
fantastic. it saved my time.
[Embed(source="/../lib/meiryo",
fontName = "myFont",
mimeType = "application/x-font",
advancedAntiAliasing="true",
embedAsCFF = "false")]
internal var japanese:Class;
thanks, saved me a lot of time
Brilliant thank u.
Post a Comment