Force mediator to recreate the view instance

Rafael Rinaldi's Avatar

Rafael Rinaldi

24 Feb, 2013 04:08 AM

Is there any way to force a mediator to recreate the view instance every time it's started?

  1. Support Staff 1 Posted by creynders on 24 Feb, 2013 12:43 PM

    creynders's Avatar

    Hmmm... Normally the mediator is only instantiated AFTER the view is added to the stage, so the view must exist first. But this behaviour can be overridden. Care to explain what you're trying to achieve exactly?

  2. 2 Posted by Rafael Rinaldi on 27 Feb, 2013 02:19 AM

    Rafael Rinaldi's Avatar

    I'm using 'navigator-as3' with robotlegs and it seems that the non-current views are not being removed from the memory. I'm trying to figure who to blame, hehe.

    Do you have any idea on how to accomplish such thing?


  3. Support Staff 3 Posted by Shaun Smith on 27 Feb, 2013 09:50 PM

    Shaun Smith's Avatar

    Mediators are normally destroyed and released when a view leaves the stage. They are garbage collected when the player runs low on memory.

    When an old view is added to the stage a second time, a new mediator is created.

    Perhaps navigator-as3 is keeping references to the views, and hence keeping them pinned in memory?

  4. 4 Posted by Rafael Rinaldi on 27 Feb, 2013 11:15 PM

    Rafael Rinaldi's Avatar

    Yup, the problem is within navigator-as3. Here is the best workaround I've found so far: (last comment)

    It works though I don't like the approach.

    Thanks for your time anyway, guys.

  5. Support Staff 5 Posted by Shaun Smith on 27 Feb, 2013 11:22 PM

    Shaun Smith's Avatar

    No probs. Sorry we couldn't be more useful. Best of luck.

    I'm closing this issue for now. Please re-open, or open a new one, if you experience further issues.

  6. Shaun Smith closed this discussion on 27 Feb, 2013 11:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac