main.lua and home.lua are almost the same in two iOS and identical to the one Android version. am not getting this error anywhere else.
main.lua:
local physics = require(“physics”);
physics.start();
physics.setScale(120);
physics.setVelocityIterations( 6 )
physics.setPositionIterations( 16 )
_W=display.viewableContentWidth
_H=display.viewableContentHeight
local storyboard = require “storyboard”
system.setAccelerometerInterval(30)
audio.setVolume( 1 )
if audio.supportsSessionProperty then
audio.setSessionProperty(audio.MixMode, audio.PlayAndRecordMixMode)
end
storyboard.gotoScene( “home”, “fade”, 400 )
home:
local storyboard = require( “storyboard” )
storyboard.isDebug=false
storyboard.disableAutoPurge = true
storyboard.purgeOnSceneChange = true
local myData = require( “mydata” )
local device = require( “device” )
local prior_scene = storyboard.getPrevious()
local font = {}
if ( device.isAndroid ) then
font.normal = “DroidSans”
font.bold = “DroidSans-Bold”
end
local scene = storyboard.newScene()
function scene:createScene( event )
local group = self.view
local background = display.newImageRect(“images/homeBkgd.png”,display.actualContentWidth, display.actualContentHeight)
background.x = 320
background.y = display.actualContentHeight/2
group:insert(background)
background:toFront()
local about2 = display.newEmbossedText("",_W*.5, _H*.825, “DroidSans-Bold”, 40 )
about2.x=_W*.5
about2.y=_H*.025
about2.isEditable=false
if myData.imageScale2==true then
about2:setSize( 40 )
end
about2.hasBackground=false
about2.alpha=1
group:insert(about2)
about2:setText(“WELCOME!”)
local color =
{ highlight = { r =1, g = 1, b = 0, a = .78
},
shadow = { r = 0, g = 0, b = 0, a = .5
}
}
about2:setEmbossColor( color )
about2:setFillColor( .38, .22, .11 )
local function playGo(event)
storyboard.gotoScene(“profile” , “crossFade”, 1000)
end
if myData.imageScale==true then
start=display.newImageRect(“images/homePlayButton@2x.png”,326,104)
start.x=myData._W*.215
start.y=myData._H*.8
start:toFront()
start.alpha=0
elseif myData.imageScale2==true then
start=display.newImageRect(“images/homePlayButton@2x.png”,293,94)
start.x=myData._W*.215
start.y=myData._H*.8
start:toFront()
start.alpha=0
else
start=display.newImageRect(“images/homePlayButton.png”,163,52)
start.x=myData._W*.215
start.y=myData._H*.8
start:toFront()
start.alpha=0
end
group:insert(start)
start:addEventListener(“tap”,playGo)
local function instructionGo(e)
storyboard.gotoScene(“instructions2” , “crossFade”, 1000)
end
if myData.imageScale==true then
instruction=display.newImageRect(“images/instructionsButton@2x.png”,326,104)
instruction.x=myData._W*.785
instruction.y=myData._H*.8
instruction:toFront()
instruction.alpha=0
elseif myData.imageScale2==true then
instruction=display.newImageRect(“images/instructionsButton@2x.png”,293,94)
instruction.x=myData._W*.785
instruction.y=myData._H*.8
instruction:toFront()
instruction.alpha=0
else
instruction=display.newImageRect(“images/instructionsButton.png”,163,52)
instruction.x=myData._W*.785
instruction.y=myData._H*.8
instruction:toFront()
instruction.alpha=0
end
group:insert(instruction)
instruction:addEventListener(“tap”,instructionGo)
local logo = display.newImageRect(“images/giveMe5logo.png”,536, 440)
logo.x = 320
logo.y = 412
group:insert(logo)
transition.to( start, { time=1000, delay=500, alpha=1 } )
transition.to( instruction, { time=1000, delay=1000, alpha=1 } )
if imageScale==true or imageScale2 ==true then
logo.xScale=1.25
logo.yScale=1.25
start.xScale=1.5
start.yScale=1.5
profile.xScale=1.5
profile.yScale=1.5
start.x=150
profile.x=start.x+start.width*2
instruction.xScale=1.5
instruction.yScale=1.5
instruction.x=myData._W*.5
instruction.y=myData._H*.9125
end
end
function scene:exitScene( event )
end
function scene:enterScene(event)
local group = self.view
local prior_scene = storyboard.getPrevious()
if prior_scene ~= nil then
storyboard.purgeScene(prior_scene)
storyboard.purgeAll()
storyboard.removeAll()
end
end
function scene:didExitScene( event )
local group = self.view
timer.performWithDelay(1, function() collectgarbage(“collect”) end)
collectgarbage()
end
scene:addEventListener( “didExitScene”, scene )
scene:addEventListener( “enterScene”, scene )
– Called prior to the removal of scene’s “view” (display group)
function scene:destroyScene( event )
local group = self.view
end
– END OF YOUR IMPLEMENTATION
– “createScene” event is dispatched if scene’s view does not exist
scene:addEventListener( “createScene”, scene )
– “enterScene” event is dispatched whenever scene transition has finished
scene:addEventListener( “enterScene”, scene )
– “exitScene” event is dispatched before next scene’s transition begins
scene:addEventListener( “exitScene”, scene )
– “destroyScene” event is dispatched before view is unloaded, which can be
– automatically unloaded in low memory situations, or explicitly via a call to
– storyboard.purgeScene() or storyboard.removeScene().
scene:addEventListener( “destroyScene”, scene )
return scene