Hi guys,
In my main.lua I have a tab bar which allows my app to navigate between three scenes “Home, Forms, and Settings” the issue i’m having is once the button is clicked on, the scene then plays the scene transition animation and changes scene, no issues. Now when I attempt to change the scene after clicking a tab button and during the scene transition animation, rather than changing to the scene I clicked on the second time I just get a white screen. Any Ideas?
Issue Example:
On Home: Tab button Form is clicked.
On Home: Transition animation begins
On Home/Form: During transition button Settings is clicked
On Form/Settings: Transition animation begins from Form to White Screen.
On Settings: White screen
My code looks like this…
[lua]
display.setDefault( “background”, 1, 1, 1 )
local widget = require( “widget” )
local composer = require “composer”
local results = composer.gotoScene( “home” )
local myImage = display.newImage( “TabBarBackground.png” )
myImage:translate( 160, 500 )
local function onFirstView( event )
composer.gotoScene( “home”, { effect=“slideRight”, time=800} )
end
local function onSecondView( event )
composer.gotoScene( “forms”, { effect=“slideRight”, time=800} )
end
local function onThirdView( event )
composer.gotoScene( “settings”, { effect=“slideRight”, time=800} )
end
local options = {
width = 105,
height = 50,
numFrames = 3,
sheetContentWidth = 315,
sheetContentHeight = 50
}
local radioButtonSheet = graphics.newImageSheet( “radioButtonSheet.png”, options )
local radioGroup = display.newGroup()
local radioButton1 = widget.newSwitch
{
left = 1,
top = 475,
style = “radio”,
id = “RadioButton1”,
width = 105,
height = 50,
initialSwitchState = true,
onPress = onFirstView,
sheet = radioButtonSheet,
frameOff = 1,
frameOn = 2
}
radioGroup:insert( radioButton1 )
local radioButton2 = widget.newSwitch
{
left = 106,
top = 475,
style = “radio”,
id = “RadioButton2”,
width = 106,
height = 50,
onPress = onSecondView,
sheet = radioButtonSheet,
frameOff = 1,
frameOn = 2
}
radioGroup:insert( radioButton2 )
local radioButton3 = widget.newSwitch
{
left = 212,
top = 475,
style = “radio”,
id = “RadioButton3”,
width = 108,
height = 50,
onPress = onThirdView,
sheet = radioButtonSheet,
frameOff = 1,
frameOn = 2
}
radioGroup:insert( radioButton3 )
[/lua]
Thanks again,
Matt.