charlesclements
charlesclements

Reputation: 86

Flash CC wont embed image assets

I have this code on the first frame of the timeline:

import flash.display.Bitmap;

[Embed("letter.jpg")]
const Letter:Class;

var letter:Bitmap = new Letter();
addChild(letter);

I get this compile time error:

Scene 1, Layer 'Layer 1', Frame 1, Line 1, Column 1 1120: Access of undefined property MainTimeline_Letter.

I have tried many ways, but I cant get Flash CC or Flash Builder to compile. The image file is in the same directory. What am I doing wrong? Please help.

Here are the source files: FILES

I try it with an MP3, and it works fine...

import flash.media.Sound;

[Embed("coffee.mp3")]
var Coffee:Class;

var snd:Sound = new Coffee();
snd.play();

Thoughts???

Update: FYI I am on a Macbook Pro OS X 10.7.5 Using Adobe Flash CC

Upvotes: 2

Views: 823

Answers (2)

PH.W
PH.W

Reputation: 123

Finally found the answer! Please go to:

/Users/"YOURNAME"/Library/Application Support/Adobe/Flash CC/

Delete everything! It should work without the undefined property error. Worth a try. Good luck!

Upvotes: 4

charlesclements
charlesclements

Reputation: 86

I ended up uninstalling Flash and reinstalling it after dealing with this for 3 days. It worked on on the first run. Thanks Adobe :-(

Update: Flash CC told me that the my memory was low in the jvm.ini file, but it rendered the embedded image on stage and you can see it. But I changed the value to 512 from 256. I closed Flash, then I reopened it. Thats when I got the compiletime error I've been wrestling with. I changed it back to 256, but then the image doesnt render on the stage (back to square 1). I am going to abandon this method and just load everything as external assets.

Upvotes: 0

Related Questions