tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/40-why-eventmap-can-auto-removeRobotlegs: Discussion 2013-04-28T10:02:51Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/9201282010-01-27T13:09:56Z2010-01-27T13:09:56Zwhy eventMap can auto remove<div><p>You MUST hold on to the context object that you create in
main:</p>
<pre>
// In your Main class definition
protected var context:MainContext;
// and then later:
context = new MainContext(this);
</pre>
<p>If there is nothing holding on to the context object, then it
will be released by the Garbage Collector when the Flash Player
needs more memory - that is probably why things are not working as
expected.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/9201282010-01-27T13:36:44Z2010-01-27T13:36:46Zwhy eventMap can auto remove<div><p>Oh my god .thanks for your help. I remember it. in My Main ,
first protected var context:MainContext and than context = new
MainContext(this) that hold on to the context object thank
you.thank you.</p></div>chenchang1209tag:robotlegs.tenderapp.com,2009-10-18:Comment/9201282010-01-27T13:40:55Z2010-01-27T13:40:55Zwhy eventMap can auto remove<div><p>No problem, I hope that helps :)</p></div>Shaun Smith