Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you need separate Flash elements on a page to communicate with each other you'll probably end up using LocalConnection. That being said, you'll need to look into using Runtime Shared Libraries (RSL) for the Flex framework - otherwise each of your SWFs will have to contain it's own copy of the Flex framework.</p> <p>Now, that being said, memory related issues don't really stem from the framework, instead they come from problems related to object references and possibly CPU hogging.</p> <p>Flash's garbage collector only runs when it has time to do so, so if your app is spiking the CPU fairly constantly, the GC may never run. If you run your app in debug mode with Flex you can force the GC to run to see if that's the case.</p> <p>Flash's GC is based on a mark-and-sweep concept. Objects that exist but don't have any references to them are first marked, and then later swept up bug the GC. This means if you leave references to "dead" objects around they will never get freed. A common culprit in this are events and event listeners. It's generally a best practice to always use weak keys (avoids making a reference that's counted by the GC) with addEventListener. </p> <pre><code>// don't do this foo.addEventListener(Event.CHANGE, onChange); // do this foo.addEventListener(Event.CHANGE, onChange, false, 0, true); </code></pre> <p>Grant Skinner has an <a href="http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html" rel="nofollow noreferrer">excellent series on resource management in AS3</a> you should check out as well.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload