Lapys
Lapys

Reputation: 87

Embedded Image not Adding to Stage

So I have an image that I'm trying to embed to use as a sprite sheet. My problem is that I am receiving no errors at all, but my image can't even be added to the stage. It's like nothing is being loaded at all.

I am using the Flash CS 5.5 compiler. Here is my code:

public class Game extends MovieClip {
    [Embed(source='../assets/images/sprite_sheet_1.png')]
    private var sheetClass:Class;
    private var sheet:Bitmap = new sheetClass();

    public function Game() {
        addChild (sheet);
    }
}

I've also tried fiddling with the x and y values to make sure nothing is just covering it up and I can't see any problems with that, either. It's just not showing up. I don't understand why it's not working as intended. Any aid would be fantastic. Thanks!

P.S. - I'm trying to embed the sprite sheet because someone recommended it would be a better route than just using URLLoaders, but is that necessarily true? Is it just true because we are talking about sprite sheets for a smallish Flash game?

Upvotes: 0

Views: 186

Answers (1)

bwroga
bwroga

Reputation: 5459

You need to check a checkbox called something like "Export SWC" under the publish settings. I'm not sure of the exact phrasing because I don't have the same version of Flash that you have.

See this page and this page

Upvotes: 1

Related Questions