local vs global

Hi Folks,

I have the following function. I want to setup the function bubbletvOff as a local function instead of the global function. Currently when i set the bubbletvOff function as local, the function is never called from the function bubbletvOn. I am forced to use global or the function does not get called. Any ideas?

[code]
local function bubbletvOn()
tvBubbleGroup.isVisible = true
transition.from(tvBubbleGroup, {time = 4200, x = 250, y = 5, transition = easingx.easeOutElastic})
timer.performWithDelay( 5000, bubbletvOff )
end

function bubbletvOff()
tvBubbleGroup.isVisible = false
end

[/code] [import]uid: 131058 topic_id: 24340 reply_id: 324340[/import]

BubbleVoff should be declared before it is called

local function bubbletvOff()
tvBubbleGroup.isVisible = false
end

local function bubbletvOn()  
 tvBubbleGroup.isVisible = true  
 transition.from(tvBubbleGroup, {time = 4200, x = 250, y = 5, transition = easingx.easeOutElastic})  
 timer.performWithDelay( 5000, bubbletvOff )  
end  

Or you could try

[code]
local function bubbletvOn()

local function bubbletvOff()
tvBubbleGroup.isVisible = false
end

tvBubbleGroup.isVisible = true
transition.from(tvBubbleGroup, {time = 4200, x = 250, y = 5, transition = easingx.easeOutElastic})
timer.performWithDelay( 5000, bubbletvOff )
end

[/code] [import]uid: 119459 topic_id: 24340 reply_id: 98343[/import]

Great, thx [import]uid: 131058 topic_id: 24340 reply_id: 98345[/import]

You can also do this:

[lua]local bubbletvOff

local function bubbletvOn()
tvBubbleGroup.isVisible = true
transition.from(tvBubbleGroup, {time = 4200, x = 250, y = 5, transition = easingx.easeOutElastic})
timer.performWithDelay( 5000, bubbletvOff )
end

function bubbletvOff()
tvBubbleGroup.isVisible = false
end[/lua] [import]uid: 10389 topic_id: 24340 reply_id: 99695[/import]