I am obviously a beginner and still don’t have a good understanding of event listeners. As it stands now I can tap on the text object on the phone that says “my dummy value” and get the first real value to show up because that makes the desired function run. The user normally taps the old value on the screen to get the next value. How can I make it run the function the first time through, as the app starts, instead of making the user tap after starting the app?
[code]
– If app just started, set subject to a dummy value and run the function to get first item
local nextSubjectDisplayObject = display.newText( “my dummy value”, 5, 400, native.systemFont, 30 )
nextSubjectDisplayObject:setTextColor(255,255,255,50)
function nextSubjectDisplayObject:tap(event)
system.vibrate()
– here call the function to a value for subject
local subject=getDrip.getHost(“s62test”)
nextSubjectDisplayObject = display.newText( subject, 5, 400, native.systemFont, 30 )
nextSubjectDisplayObject:setTextColor(255,255,255,50)
end
------------LISTENERS
– event listener for a tap on the next subject text object
nextSubjectDisplayObject:addEventListener(“tap”, nextSubjectDisplayObject)
[/code] [import]uid: 10016 topic_id: 3028 reply_id: 303028[/import]