cocos2d: not a plist file


#1

Hi there. I’m having this weird problem where Firefox console throws me that error when this line of code runs: “cc.SpriteFrameCache.getInstance().addSpriteFrames(heroPlist);”

resources.js

var dirArt = "Art/",
    heroSprite = dirArt + "ninja.png",
    heroSpriteSheet = dirArt + "ninjaSprite.png",
    level01 = dirArt + "level.tmx",
    tileset = dirArt + "tileset.png",
    heroPlist = dirArt + "minga.plist",
    heroPlistImg = dirArt + "minga.png";

var g_ressources = [

    { type: "image", src: heroSprite },
    { type: "image", src: heroSpriteSheet },

    { type: "tmx", src: level01 },
    { type: "image", src: tileset }, 

    { type: "image", src: heroPlistImg },
    { type: "plist", src: heroPlist }

];

runnerLayer.js

...
    onEnter: function()
    {
        this._super();
        if ('touches' in sys.capabilities)
            this.setTouchEnable(true);

        if ('mouse' in sys.capabilities)
            this.setMouseEnabled(true);

        this.setKeyboardEnabled(true);

        // this.hero = new Hero();
        // this.hero.setPosition(400, 40);
        // this.addChild(this.hero);

        // this.level = new Level();
        // this.addChild(this.level);


        this.sprite = cc.Sprite.create();

        cc.SpriteFrameCache.getInstance().addSpriteFrames(heroPlist);

        var frame = cc.SpriteFrameCache.getInstance().getSpriteFrame("Walk_left00.png");
        this.sprite.initWithSpriteFrame(frame);

        this.scheduleUpdate();
    },
...

main.js

var cocos2dApp = cc.Application.extend({

    config: document['ccConfig'],

    ctor: function (scene) {
        this._super();
        this.startScene = scene;
        cc.COCOS2D_DEBUG = this.config['COCOS2D_DEBUG'];
        cc.initDebugSetting();
        cc.setup(this.config['tag']);

        cc.AppController.shareAppController().didFinishLaunchingWithOptions();
    },

    applicationDidFinishLaunching: function () {
        director = cc.Director.getInstance();
        director.setDisplayStats(this.config['showFPS']);
        director.setAnimationInterval(1.0 / this.config['frameRate']);

        winSize = director.getWinSize();
        centerPos = cc.p( winSize.width/2, winSize.height/2 );


        // LOAD RESOURCES
        cc.LoaderScene.preload([], function() {
            director.replaceScene(new this.startScene());
        }, this);

        return true;
    }
});

var director;
var winSize;
var centerPos;
var myApp = new cocos2dApp(RunnerLayer.scene);

Well, that’s my problem. I think it has something to do with parsing xml files cause I’m also having problems when I try to use tmx files. And because when I debugg it there were some strange things happening with xml.
That’s it, thanks.


#2

don’t use setSearchPaths() and setSearchResolutionsOrder() in main.js