Hi,
I am very new to Corona, and I’m trying to do a few basic things, i think i’m quite close but not exactly there.
I just want to show a list of records from an sqlite database (id,name,description).
Each of the records will be in a group which can show an image and some text and will act as a button.
Each button will have an eventlistener which when you click on it will invoke the director class and change scene (passing the id through so it can be used on the next page).
I have the following:
[lua] contentGroup=display.newGroup();
local sql=“select * from records limit 10”
for row in db:nrows(sql) do
count = count + 1;
local thisBtn = display.newGroup();
local name = display.newText(row.name,0,30+(30*count),native.systemFontBold,20);
thisBtn:insert(name);
– Add the event Listener
thisBtn:addEventListener(“touch”,changeScene);
contentGroup:insert(thisBtn);
end[/lua]
I then have my changeScene function set up but at the moment doing nothing, when I click on a button at the minute, it seems to hit it however many records I have in the db, so if I have 4 records it will go in to the function 4 times instead of just the once. How do I get this working and have access to the id within the next scene??? I am using director to change scenes.
Thanks
[import]uid: 72726 topic_id: 11860 reply_id: 311860[/import]