Hi guys,
I 'm trying to make a simple calculation, I have created two text fields both use number input. What I am trying to do is when the user enters and input into both text fields at new text and will present what both of them multiplied together is. How would this look this is what I have but it doesn’t work at all…
[lua]
–textResults
local textResults= display.newText(“0”,
172, 180, display.contentWidth, display.contentHeight * 0.5, native.systemFont, 13 )
textResults:setFillColor( 0, 0, 0 )
–textboxVaule1
local textboxVaule1 = native.newTextField( 50, 120, 75, 40 )
textboxVaule1.size = 20
textboxVaule1:addEventListener( “userInput”, textboxVaule1 )
–textboxVaule2
local textboxVaule2 = native.newTextField( 50, 120, 75, 40 )
textboxVaule2.size = 20
textboxVaule2:addEventListener( “userInput”, textboxVaule2 )
local function btnNext ( event )
textboxValue1.text * textboxValue2.text = textResult.text
end
–btnNext
local btnNext = widget.newButton
{
width = 150,
height = 40,
defaultFile = “btnNext.png”,
onEvent = btnNext
}
btnNext.x = 235
btnNext.y = 445
[/lua]
Thanks again,
Matt.