display.newSprite not allowing sequence change?

Hi All,

My display.newSprite objects arn’t switching sequences but instead always playing the first sequence even when I tell it to play any others. Any help would be great.

Thanks
Chris

[lua]if display.contentScaleX == .5 then
survivalImageSheet = graphics.newImageSheet(“images/sheets/survivalModeSheet2.png”, {width = 520, height = 90, numFrames = 11})
else
survivalImageSheet = graphics.newImageSheet(“images/sheets/survivalModeSheet.png”, {width = 260, height = 46, numFrames = 11})
end
sequenceData = { {
name=“turningOff”,
frames= { 6, 5, 4, 3, 2, 1},
time = 500,
loopCount = 1
},
{
name=“turningOn”,
frames= { 1, 2, 2, 2, 3, 3, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6},
time = 3000,
loopCount = 1
}
}
survivalMode = display.newSprite( survivalImageSheet, sequenceData)

survivalMode:play(“turningOn”) – Should play turningOn sequence but instead plays turningOff [import]uid: 126017 topic_id: 29680 reply_id: 329680[/import]

you should first use:
[blockcode]
survivalMode:setSequence(“turningOn”)
[/blockcode]

That will select which sequence you want and display its first frame.
Later in order to play it just call:
[blockcode]
survivalMode:play()
[/blockcode] [import]uid: 105206 topic_id: 29680 reply_id: 119200[/import]

hey,

thank you very much that solved the problem

best,
Chris [import]uid: 126017 topic_id: 29680 reply_id: 119397[/import]