Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

MTE not being destroyed with composer.removeScene()?
Started by chris.kocuba Mar 07 2015 02:41 PM

No replies to this topic
composer removescene debug
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

chris.kocuba

[GLOBAL: userInfoPane.html]
chris.kocuba
  • Observer

  • 5 posts
  • Corona SDK

Hello- The situation I am encountering is when using MTE in a scene where the scene is meant to be repeated with the press of a Try Again button. Upon pressing the Try Again button, the composer is directed to a tryagain.lua which only does two things:

 

function scene:show( event )
 
    local sceneGroup = self.view
    local phase = event.phase
 
 
    if ( phase == "will" ) then
 
 
       composer.removeScene("scene1")
       composer.gotoScene("scene1",options)
       
end
 
So all this does is remove the scene I was just in and loads back to a fresh version of it. However, upon reload two noticeable things occur:
 
1.) The mte.debug() readout from the prior session is still on screen. Upon the Runtime event listener trigger on successive loads, a new mte.dubug() readout is written over top of the prior with both existing simultaneously. This leads me to believe that the old MTE instance is still active. Please refer to the following image:
 
 
2.) The game timers are running faster with each restart of the same scene. 
 
 
 
From these two results, I'd say that composer is not removing the prior MTE instance so my questions are this:
 
1.) Is there a way for destroy an old instance of MTE? 
2.) Would code order and the location of things like mte = require("mte").createMTE() have an effect? I have tried putting mte = require("mte").createMTE() outside of all scene code AND in the function scene:create( event ) but each produces the same result.
3.) I believe I am unloading all event listeners before leaving the scene. What else could cause the issue I see?
 
Thanks in advance.



[topic_controls]
[/topic_controls]