Sprite Sheet - not working

Hi,
I can’t get sprite sheet function working with director class. It crashes the app. Any idea if there is a bug or maybe an example of an app with sprite sheet and director class?

cheers

PS: I’m talking about this sprite sheet: http://developer.anscamobile.com/reference/index/spritenewsprite
[import]uid: 27699 topic_id: 7453 reply_id: 307453[/import]

Here’s a working example:-

main.lua

  
director = require "director"  
  
display.setStatusBar( display.HiddenStatusBar )  
  
local mainGroup = display.newGroup()  
  
mainGroup:insert(director.directorView)  
  
director:changeScene("scene1")  
  

scene1.lua

[code]

module(…, package.seeall)

require “sprite”

local localGroup = display.newGroup()

function new()

local sheet1 = sprite.newSpriteSheet( “runningcat.png”, 512, 256 )
local spriteSet1 = sprite.newSpriteSet(sheet1, 1, 8)
sprite.add( spriteSet1, “cat”, 1, 8, 1000, 0 ) – play 8 frames every 1000 ms
local instance1 = sprite.newSprite( spriteSet1 )

instance1.x = display.contentWidth / 2
instance1.y = display.contentHeight / 2
instance1.xScale = .5
instance1.yScale = .5

instance1:prepare(“cat”)
instance1:play()

return localGroup

end
[/code] [import]uid: 8366 topic_id: 7453 reply_id: 26437[/import]

Hi,
Thanks a lot for that :), your example works perfect. But my game still crashes… No idea what is the reason, it works fine in the emulator but when I build it and run on the device, it just exits… If anyone have similar issues or know what is going on, pleas let me know.
PS: Debug is clean in the emulator… [import]uid: 27699 topic_id: 7453 reply_id: 26503[/import]

Hi again,
I manage to solve the problem. Which was ridicules to be honest. I use GluIt to create spritesheets, and it exports files with extension .PNG instead of .png. Capital PNG was breaking the game :s. So I just have to import image into Pain.net and export it again and it all work just fine :).

M [import]uid: 27699 topic_id: 7453 reply_id: 26586[/import]