Skip to main content
Participating Frequently
April 15, 2013
Answered

How to add a jpeg to CS6/AS3....unable to resolve XXX.jpeg for transcoding

  • April 15, 2013
  • 1 reply
  • 884 views

Hi all,

Im having problems adding jpeg images to my code, i thought i could just drag them into the library, this worked because they are now in the library however i keep getting:

Scene 1, Layer 'Action', Frame 81, Line 14unable to resolve 'xxx.jpg' for transcoding
Scene 1, Layer 'Action', Frame 81, Line 14Unable to transcode xxx.jpg.

I tried looking online but i couldnt find a solution!

my code is:

[Embed (source="xxx.jpg")]

var xxxImage: Class;

thanks in advance!

This topic has been closed for replies.
Correct answer kglad

embed code directives should be used in class files.

for timeline coding, assign a class to your jpg (eg, JPG1), and use code similar to:

var jpg1:JPG1=new JPG1();

var bmp:Bitmap=new Bitmap(jpg1);

addChild(bmp);

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 15, 2013

embed code directives should be used in class files.

for timeline coding, assign a class to your jpg (eg, JPG1), and use code similar to:

var jpg1:JPG1=new JPG1();

var bmp:Bitmap=new Bitmap(jpg1);

addChild(bmp);

redGAuthor
Participating Frequently
April 15, 2013

Thanks very much! the problem I have is that im comfortable with as2 but not so much as3 yet.

kglad
Community Expert
Community Expert
April 15, 2013

you're welcome.