0

I am just learning Starling, trying to put an image on the canvas.

the code I am looking at looks like this:

[Embed(source="wordvillelogo.png")]
public static const Mushroom:Class; 

The image itself in located in the same directory as my .as files and FLA file.

Yet, when I compile the code I get an error

unable to resolve 'wordvillelogo.png' for transcoding

What is the correct format to embed this image?

4

3 回答 3

1

Put a '/' before you're path and it works... ?

http://karlvansanten.blogspot.nl/2009/04/unable-to-resolve-for-transcoding.html

于 2013-09-10T12:36:01.527 回答
1

if Piterwilson`s answer is not true, try this:

[Embed(source="./wordvillelogo.png")]
public static const Mushroom:Class; 
于 2013-09-11T15:00:22.427 回答
0

You shouldn't use Embed to manage assets if you are targeting mobile. Embed is really slow and could hurt performance specially on the iPad 1 and some older android devices.

You should create an assets folder, embed it with your app and use starling's AssetManager class to get your assets. That's the fastest way, you already get your image as a texture so you don't have to create bitmapdata objects, passing them to a new texture, etc.

于 2013-10-05T23:16:19.127 回答