In director class 1.3 I get the below error but when I went back to 1.2, I didn’t get the error. Can somebody tell me what this error means?
Runtime error
/Users/ebay/Desktop/MindTapper/director.lua:440: ERROR: table expected. If this is a function call, you might have used ‘.’ instead of ‘:’
stack traceback:
[C]: ?
[C]: in function ‘insert’
/Users/ebay/Desktop/MindTapper/director.lua:440: in function ‘_listener’
?: in function <?:446>
?: in function <?:215>
Director ERROR: Failed to execute function: 0x1329e5c0( params ) function on ‘screen9’.
My code
[lua]module(…, package.seeall)
function new()
local localGroup = display.newGroup()
local inputFontSize = 100
local inputFontHeight = 80
local tHeight = 100
local ui = require(“ui”)
local number = _G.numberSix
if number == nil then number = 0 end
local screen9 = display.newImage (“screen9.png”)
localGroup:insert(screen9)
–> This sets Screen9
local play = display.newImage (“play.png”)
play.x = 100
play.y = 55
play.xScale = .5
play.yScale = .5
localGroup:insert(play)
local function touchedPlay (event)
if (“ended” == event.phase) then
director:changeScene (“titlescreen”, “fade”)
media.playEventSound( “click_x.caf” )
end
end
play:addEventListener (“touch”, touchedPlay)
local rateit = display.newImage (“rateit.png”)
rateit.x = 225
rateit.y = 55
rateit.xScale = .5
rateit.yScale = .5
localGroup:insert(rateit)
–>This places the ratite button
local digitSum = 0
local reminder
if number ~=nil then
while number ~=0 do
reminder = number % 10
digitSum = digitSum + reminder
number = (number - (number % 10)) /10
end
end
divisionBal = 9 - (digitSum % 9)
–setting to avoid the error
if divisionBal == nil then divisionBal = 0 end
if digitSum == nil then digitSum =0 end
– the sum value will be in digitSum
– reminder value will be in divisionBal
local function onnumberFieldReminder( event )
if ( “ended” == event.phase ) or ( “submitted” == event.phase ) then
end
end
– showing the reminder in a textfield
numberFieldReminder = native.newTextField( 180, 300, 100, tHeight, onnumberFieldReminder)
numberFieldReminder.font = native.newFont( native.systemFontBold, inputFontSize )
numberFieldReminder.inputType = “number”
numberFieldReminder.align = “center”
numberFieldReminder.text = reminder
localGroup:insert(numberFieldReminder)
–>MUST return a display.newGroup()
–> This is how we end every file except for director and main, as mentioned in my first comment
return localGroup
end[/lua] [import]uid: 72372 topic_id: 13957 reply_id: 313957[/import]