I am trying to display an overlay on top of another overlay and everything looks fine until I try to go back to the original overlay. I get an error that the lua doesn’t exist. It is not a lua. It is in the code.
[lua]local grpBplcyscene = storyboard.newScene( “grpBplcyscene” )
function grpBplcyscene:createScene(event)
display.remove( viewButton )
viewButton = nil
local group = self.view
local grpBplcyrectext = display.newRoundedRect(0, 60, display.contentWidth-5,340,12 )
local function ongrpBDoneRelease( event )
display.remove( grpBdoneButton )
grpBdoneButton = nil
storyboard.hideOverlay(true, “fade”)
storyboard.showOverlay( “eligiblescene”, {isModal=true, effect = “fade”} )
end
– button below is local because of forward declaration defined earlier
grpBdoneButton = widget.newButton{
style = “blue1Small”,
label = “Done”,
onRelease = ongrpBDoneRelease
}
grpBdoneButton.x = 275
grpBdoneButton.y = 375
local grpBplcytitle = “Group B Policy Information”
local grpBplcytxt1 = “Each plan allows you to insure up to your average daily wage, with benefits ranging from $60 to $201 in increments of $3. The plans offer a variety of discipline days. Coverage increases each year the policy is in force.\n\n”
local grpBplcytxt2 = “NO 7: First year coverage starts at 250 days and reaches a maximum number of 365 covered discipline days per year or per claim in four years.\n\n”
local grpBplcytxt3 = “NO 10: First year coverage starts at 180 days and reaches a maximum number of 300 days per year or per claim in five years. Also included an accidental death feature that protects the member on and off the job. It also provides an accidental death benefit to your beneficiary at no extra cost.\n\n”
– don’t forget to insert objects into the scene group!
group:insert(grpBplcyrectext)
group:insert(grpBdoneButton)
local grpBplcytxttitle = display.newText( group, grpBplcytitle, 6, 62, display.contentWidth-12, 60, native.systemFontBold, 24 )
grpBplcytxttitle:setTextColor ( 251,170,39 )
local grpBplcytxt = display.newText( group, grpBplcytxt1…grpBplcytxt2…grpBplcytxt3, 6, 90, display.contentWidth - 12, 275, native.systemFont, 14 )
grpBplcytxt:setTextColor ( 0)
end
grpBplcyscene:addEventListener( “createScene”, grpBplcyscene )
local groupid = “”
local eligiblescene = storyboard.newScene( “eligiblescene” )
function eligiblescene:createScene(event)
local group = self.view
local eligiblerectext = display.newRoundedRect(0, 60, display.contentWidth-5,340,12 )
local columnData = {}
columnData[1] = {}
columnData[1][1]=“ACRE”
columnData[1][2]=“AEF”
columnData[1][3]=“ARASA”
columnData[1][4]=“ATDA”
columnData[1][5]=“ATDD”
columnData[1][6]=“ATU”
columnData[1][7]=“BLET”
columnData[1][8]=“BMWE”
columnData[1][9]=“BRC”
columnData[1][10]=“BRS”
columnData[1][11]=“HERE”
columnData[1][12]=“HO”
columnData[1][13]=“IAMAW”
columnData[1][14]=“IBB”
columnData[1][15]=“IBEW”
columnData[1][16]=“IBT”
columnData[1][17]=“ILA”
columnData[1][18]=“LI”
columnData[1][19]=“NCFO”
columnData[1][20]=“OTHER”
columnData[1][21]=“REA”
columnData[1][22]=“SEIU”
columnData[1][23]=“SMWIA”
columnData[1][24]=“SPU”
columnData[1][25]=“TCRC”
columnData[1][26]=“TCU”
columnData[1][27]=“TCUC”
columnData[1][28]=“TCW”
columnData[1][29]=“TWU”
columnData[1][30]=“UNK”
columnData[1][31]=“USEU”
columnData[1][32]=“USWA”
columnData[1][33]=“UTU”
columnData[1][34]=“WRSA”
columnData[1].alignment = “right”
columnData[1].width = 60
columnData[1].startIndex = unionIndex or 1
columnData[2] = {}
columnData[2][1]=“AIR TRAFFIC CONTROLLER”
columnData[2][2]=“AIRFIELD OPERATIONS SPECIALIST”
columnData[2][3]=“AIRLINE PERSONNEL”
columnData[2][4]=“AIRLINE PILOT”
columnData[2][5]=“ASST SIGNALMAN”
columnData[2][6]=“BRAKEMAN”
columnData[2][7]=“BRIDGE TENDER”
columnData[2][8]=“BUS DRIVER”
columnData[2][9]=“CAR DRIVER”
columnData[2][10]=“CAR INSPECTOR”
columnData[2][11]=“CARMAN”
columnData[2][12]=“CLERK”
columnData[2][13]=“CONDUCTOR”
columnData[2][14]=“CRANE OPR”
columnData[2][15]=“CREW CALLER”
columnData[2][16]=“CREW MGR”
columnData[2][17]=“DELIVERY TRUCK DRIVERS”
columnData[2][18]=“DIESEL FOREMAN”
columnData[2][19]=“DISPATCH”
columnData[2][20]=“DOCK WORKER”
columnData[2][21]=“ELECTRICIAN”
columnData[2][22]=“ENGINEER”
columnData[2][23]=“ENGINEER/MWE”
columnData[2][24]=“ENGR DEPT CO-ORDINATOR”
columnData[2][25]=“FIREMAN”
columnData[2][26]=“FLAGMAN”
columnData[2][27]=“FOREMAN”
columnData[2][28]=“HEAVY TRUCK DRIVERS”
columnData[2][29]=“HOSTLER”
columnData[2][30]=“LABORER”
columnData[2][31]=“LONG SHRMN/DCK WRKR”
columnData[2][32]=“MACHINE OPR”
columnData[2][33]=“MACHINIST”
columnData[2][34]=“MECH LABORER”
columnData[2][35]=“MECH MAINTENANCE”
columnData[2][36]=“MGR TRACK MAINTENANCE”
columnData[2][37]=“MISCELLANEOUS”
columnData[2][38]=“ON BOARD SERVICE”
columnData[2][39]=“OPERATOR”
columnData[2][40]=“POSTAL CARRIER”
columnData[2][41]=“PRE LOADER”
columnData[2][42]=“PUMP REPAIR MAN”
columnData[2][43]=“RR TRAFFIC CONTROLLER”
columnData[2][44]=“SAILOR MARINE OILER”
columnData[2][45]=“SHEET METAL WORKER”
columnData[2][46]=“SHIP CAPTAINS MATES PILOTS”
columnData[2][47]=“SHIP ENGINEER”
columnData[2][48]=“SIGNAL INSPECTOR”
columnData[2][49]=“SIGNAL MAINTAINER”
columnData[2][50]=“SIGNALMAN”
columnData[2][51]=“SORTER/AIR DRIVER”
columnData[2][52]=“STEEL WORKER”
columnData[2][53]=“SUBWAY CONDUCTOR”
columnData[2][54]=“SWITCHMAN”
columnData[2][55]=“TRACK FOREMAN”
columnData[2][56]=“TRACK REPAIRMAN”
columnData[2][57]=“TRACK SUPER/INSP”
columnData[2][58]=“TRACKMAN”
columnData[2][59]=“TRAIN OPERATOR”
columnData[2][60]=“TRAIN OPR/US STEELE”
columnData[2][61]=“TRAINMAN”
columnData[2][62]=“TRANS RPT SERV”
columnData[2][63]=“TRUCK DRIVER”
columnData[2][64]=“UPS DRIVER”
columnData[2][65]=“UPS LOADER”
columnData[2][66]=“UTILITY TECHNICIAN”
columnData[2][67]=“VAN DRIVER”
columnData[2][68]=“WELDER”
columnData[2][69]=“YARD SERVICE”
columnData[2][70]=“YARDMASTER”
columnData[2].alignment = “center”
columnData[2].width = 60
columnData[2].startIndex = craftIndex or 1
– create pickerWheel widget
local picker = widget.newPickerWheel{
top=120,
font=native.systemFontBold,
fontSize=12,
columns=columnData,
}
local function onDoneRelease( event )
display.remove( picker )
picker = nil
display.remove( doneButton )
doneButton = nil
storyboard.hideOverlay(true, “fade”)
end
local function onViewRelease( event )
local pickerValues = picker:getValues()
unionIndex = pickerValues[1].index
craftIndex = pickerValues[2].index
unionName = pickerValues[1].value
if string.find(“ATDA,ATDD,BLET,OTHER,TCRC,TCU,UNK,USWA,UTU”,unionName,1,true)==nil then
groupid =“B”
else
groupid=“A”
end
display.remove( picker )
picker = nil
display.remove( doneButton )
doneButton = nil
if groupid == “B” then
storyboard.showOverlay( “grpBplcyscene”, {isModal=true, effect = “fade”} )
else
storyboard.showOverlay( “grpAplcyscene”, {isModal=true, effect = “fade”} )
end
end
– button below is local because of forward declaration defined earlier
doneButton = widget.newButton{
style = “blue1Small”,
label = “Done”,
onRelease = onDoneRelease
}
doneButton.x = 275
doneButton.y = 375
viewButton = widget.newButton{
style = “blue1Small”,
label=“View”,
onRelease = onViewRelease
}
viewButton.x = 75
viewButton.y = 375
local eligibletitle = “Choose Union and Craft”
– don’t forget to insert objects into the scene group!
group:insert(eligiblerectext)
group:insert(doneButton)
local eligibletxttitle = display.newText( group, eligibletitle, 6, 62, display.contentWidth-12, 60, native.systemFontBold, 24 )
eligibletxttitle:setTextColor ( 251,170,39 )
end
eligiblescene:addEventListener( “createScene”, eligiblescene )[/lua]
[import]uid: 136344 topic_id: 31316 reply_id: 331316[/import]