I wrote a sample app to test twitter. I want to include it in my app at various places to share high scores.
The problem is my close button does not fire, leaving the web popup on the screen at all times. Is there something wrong with the way that I am calling this? Also will this work on iOS devices?
Here is the code:
[code]
local tweetbttn, tweetbttntext, closebttn, closebttntext
function tweet()
native.showWebPopup( 0,0,320,380,“http://twitter.com/intent/tweet?text=My%20test%20tweet%20goes%20here” )
end
function closeTweet()
native.cancelWebPopup()
end
function main()
tweetbttn = display.newRoundedRect(15, 400, 120, 60, 10)
tweetbttn:setFillColor( 255, 255, 0)
tweetbttntext = display.newText( ‘TWEET’, 30, tweetbttn.y - 10, system.font, 24 )
tweetbttntext:setTextColor ( 255, 0, 0 )
tweetbttn:addEventListener( “touch”, tweet)
closebttn = display.newRoundedRect( 180, 400, 120, 60, 10 )
closebttn:setFillColor( 255, 255, 0)
closebttntext = display.newText(‘CLOSE’, 200, closebttn.y -10 , system.font, 24)
closebttn:addEventListener( “touch”, closeTweet)
closebttntext:setTextColor (255, 0, 0 )
end
main()
[/code] [import]uid: 124716 topic_id: 29410 reply_id: 329410[/import]
[import]uid: 52491 topic_id: 29410 reply_id: 118162[/import]