Director class & SQLite data

Hi guys,

I’m trying to display the contents of a table and have gotten so far.

I have managed to display the contents using a “for” loop, but cannot seem to remove the displayed contents when the scene changes.
Has anyone managed to do this without any issues?
Thanks [import]uid: 40538 topic_id: 10033 reply_id: 310033[/import]

If you insert the contents into your display group, they will be removed with your previous scene. This is very important when using the director class. View his video tutorial here:

http://rauberlabs.blogspot.com/2010/12/director-video-tutorial.html [import]uid: 31262 topic_id: 10033 reply_id: 36604[/import]

aaaron,

I’ve been using director class for a while now and understand that I need to insert the contents into the display group for it be included in the scene change.

Despite this, it is still not working, and I’m pretty sure it’s got something to do with this “for” loop that I’m using:

  
local function showScores ()  
 for row in db:nrows("SELECT \* FROM scores") do  
  
 local text = row.Round.." "..row.Score  
 local t = display.newText(text, 20, 30 \* row.id, null, 16)  
 t:setTextColor(255,0,255)  
  
  
 end  
end  
  

I’ve tried localGroup:insert(t), (text), and also (t) & (text) together, both below the setTextColor, and also at the end where I insert all the display objects into the group - but nothing seems to work. [import]uid: 40538 topic_id: 10033 reply_id: 36639[/import]

I’ve decided not to use a database, and everything is working great now! [import]uid: 40538 topic_id: 10033 reply_id: 36657[/import]