hi
i have a problem, im not very good at lua/corona yet
i have made an app to android where you can tap 5 buttons and it will play a short sound
it works in the simulator but now when i upload to my android htc phone it wont work, and its driving me nuts
please help.
i have placed the main.lua code here, could not attach it
please
–
– main.lua
– Your code here
local background = display.newImage(“clouds.png”)
– text til forside
local textObject = display.newText( “Tap a box”, 82, 50, nil, 30 ) textObject:setTextColor( 255,255,255 )
local button = display.newImage( “button.png” )
button.x = display.contentWidth / 4
button.y = display.contentHeight - 50
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
end
button:addEventListener( “tap”, button )
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
media.playEventSound( “sound1.mp3” )
end
–lyd/knap 2–
local button = display.newImage( “button2.png” )
button.x = display.contentWidth / 1.40
button.y = display.contentHeight - 50
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
end
button:addEventListener( “tap”, button2 )
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
media.playEventSound( “sound2.wav” )
end
–lyd/knap 3–
local button = display.newImage( “button3.png” )
button.x = display.contentWidth / 1.40
button.y = display.contentHeight - 250
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
end
button:addEventListener( “tap”, button3 )
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
media.playEventSound( “sound3.wav” )
end
–lyd/knap 4–
local button = display.newImage( “button4.png” )
button.x = display.contentWidth / 4
button.y = display.contentHeight - 250
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
end
button:addEventListener( “tap”, button4 )
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
media.playEventSound( “sound4.wav” )
end
–lyd/knap 5–
local button = display.newImage( “button4.png” )
button.x = display.contentWidth / 2.09
button.y = display.contentHeight - 150
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
end
button:addEventListener( “tap”, button5 )
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
media.playEventSound( “sound5.mp3” )
end
–lyd/knap 6–
local button = display.newImage( “button6.png” )
button.x = display.contentWidth / 2.09
button.y = display.contentHeight - 350
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
end
button:addEventListener( “tap”, button6 )
function button:tap( event )
local r = math.random( 0, 255 )
local g = math.random( 0, 255 )
local b = math.random( 0, 255 )
textObject:setTextColor( r, g, b )
media.playEventSound( “sound-dont-touch-phone.mp3” )
If one of you know a bettere way to make the app/program please write to me, I really want to learn and understand lua/corona
end