Thanks for the response Brent.
Were you able to see the attached code? If not, I have pasted the bottom part of the code below.
I would appreciate any comments you have about the disposal of the page (scene.)
Thanks so much!
Christi
[lua]–
– (BOTTOM) External code will render here
end --ends phase did
end – ends scene:show
function scene:hide( event )
– all disposal happens here
if event.phase == “will” then
if audio.isChannelActive ( 1 ) then
audio.stop(1);
end
audio.dispose(allAudios.pageflip); allAudios.pageflip = nil
if audio.isChannelActive ( 2 ) then
audio.stop(2);
end
audio.dispose(allAudios.flagin); allAudios.flagin = nil
if audio.isChannelActive ( 3 ) then
audio.stop(3);
end
audio.dispose(allAudios.button17); allAudios.button17 = nil
if audio.isChannelActive ( 5 ) then
audio.stop(5);
end
audio.dispose(allAudios.funk_guitar_rif); allAudios.funk_guitar_rif = nil
if audio.isChannelActive ( 6 ) then
audio.stop(6);
end
audio.dispose(allAudios.button27); allAudios.button27 = nil
if audio.isChannelActive ( 10 ) then
audio.stop(10);
end
audio.dispose(allAudios.magic_bell_3); allAudios.magic_bell_3 = nil
if (allAudios.paintbrush_singx9 ~= 0 and allAudios.paintbrush_singx9 ~= nil) then audio.stop(allAudios.paintbrush_singx9); allAudios.paintbrush_singx9 = nil end; audio.dispose(allAudios.paintbrush_sing); allAudios.paintbrush_sing = nil;
if (allAudios.firework_mediumx9 ~= 0 and allAudios.firework_mediumx9 ~= nil) then audio.stop(allAudios.firework_mediumx9); allAudios.firework_mediumx9 = nil end; audio.dispose(allAudios.firework_medium); allAudios.firework_medium = nil;
if audio.isChannelActive ( 7 ) then
audio.stop(7);
end
audio.dispose(allAudios.pull_cord_style); allAudios.pull_cord_style = nil
if audio.isChannelActive ( 13 ) then
audio.stop(13);
end
audio.dispose(allAudios.cheering9sec); allAudios.cheering9sec = nil
if (allAudios.zipper_1x9 ~= 0 and allAudios.zipper_1x9 ~= nil) then audio.stop(allAudios.zipper_1x9); allAudios.zipper_1x9 = nil end; audio.dispose(allAudios.zipper_1); allAudios.zipper_1 = nil;
if audio.isChannelActive ( 15 ) then
audio.stop(15);
end
audio.dispose(allAudios.bechamp2final); allAudios.bechamp2final = nil
if audio.isChannelActive ( 17 ) then
audio.stop(17);
end
audio.dispose(allAudios.bechamp4final); allAudios.bechamp4final = nil
if audio.isChannelActive ( 18 ) then
audio.stop(18);
end
audio.dispose(allAudios.bechamp5final); allAudios.bechamp5final = nil
if audio.isChannelActive ( 14 ) then
audio.stop(14);
end
audio.dispose(allAudios.bechamp1final); allAudios.bechamp1final = nil
if audio.isChannelActive ( 18 ) then
audio.stop(18);
end
audio.dispose(allAudios.bechamp3final); allAudios.bechamp3final = nil
if (allAudios.whipwhoosh03x9 ~= 0 and allAudios.whipwhoosh03x9 ~= nil) then audio.stop(allAudios.whipwhoosh03x9); allAudios.whipwhoosh03x9 = nil end; audio.dispose(allAudios.whipwhoosh03); allAudios.whipwhoosh03 = nil;
Runtime:removeEventListener(“enterFrame”, composer.kClean)
composer.cancelAllTweens(); composer.cancelAllTransitions();
physics.stop()
composer.cancelAllTimers();
elseif event.phase == “did” then
composer.test = nil
end
end
function scene:destroy( event )
– Remove all unecessary composer items
composer.mt_kwkconf_blcir = nil
layer.gp_kwkconf_blcir:removeSelf(); layer.gp_kwkconf_blcir = nil
composer.mt_kwkconf_redcir = nil
layer.gp_kwkconf_redcir:removeSelf(); layer.gp_kwkconf_redcir = nil
composer.mt_kwkconf_staror = nil
layer.gp_kwkconf_staror:removeSelf(); layer.gp_kwkconf_staror = nil
composer.mt_kwkconf_ciryel = nil
layer.gp_kwkconf_ciryel:removeSelf(); layer.gp_kwkconf_ciryel = nil
composer.mt_kwkconf_sqpink = nil
layer.gp_kwkconf_sqpink:removeSelf(); layer.gp_kwkconf_sqpink = nil
composer.mt_kwkconfsqbl = nil
layer.gp_kwkconfsqbl:removeSelf(); layer.gp_kwkconfsqbl = nil
composer.mt_kwkconf_sqrppl = nil
layer.gp_kwkconf_sqrppl:removeSelf(); layer.gp_kwkconf_sqrppl = nil
composer.mt_kwkconf_starbl = nil
layer.gp_kwkconf_starbl:removeSelf(); layer.gp_kwkconf_starbl = nil
composer.mt_kwkconf_stargr = nil
layer.gp_kwkconf_stargr:removeSelf(); layer.gp_kwkconf_stargr = nil
composer.kClean = nil
end
scene:addEventListener( “create”, scene )
scene:addEventListener( “show”, scene )
scene:addEventListener( “hide”, scene )
scene:addEventListener( “destroy”, scene )
return scene
[/lua]