Hi there!
I have a city database (in another file) and rectangle where city and country are shown. Everything works fine. Now I want to show a next city by clicking the rectangle. But when I click it, nothing happens. What am I doing wrong?
[code]local citytable = require(“citibase”)
local geo = citibase.cities
local bg = display.newImageRect(“images/bg.jpg”, 320, 480);
bg:setReferencePoint(display.TopLeftReferencePoint);
bg.x=0;
bg.y=0;
local i=1
local rect = display.newRoundedRect(0,0,280,100, 10);
rect:setFillColor(0,0,0, 192);
local city = display.newText(( geo[i].city ), 0,0, “Segoe UI SemiBold”, 28);
local country = display.newText(( geo[i].country ), 0, 0, “Segoe UI”, 16);
city:setReferencePoint(display.TopLeftReferencePoint);
country:setReferencePoint(display.TopLeftReferencePoint);
local window = display.newGroup();
window:insert(rect);
window:insert(city);
window:insert(country);
window.x = 20; window.y = 40
city.x = 15; city.y = 10
country.x = 16; country.y = 43
function touchHandler(e)
if(e.phase == “ended”) then
i=i+1;
end
end
window:addEventListener(“touch”, touchHandler);[/code]
Thanks! [import]uid: 117007 topic_id: 20341 reply_id: 320341[/import]
