Rather than constantly tracking which objects to release and how to release them, you can define blocks of code where you access the Fireworks DOM. In these blocks of code, the ActionScript stubs can keep track of all the proxy objects allocated. Then, at the end of the block of code, a single command will automatically release all objects allocated in the block.
Here is an example:
RPCMethods.CreateAutoReleasePool(); var selObject = fw.selection.get(0); RPCMethods.DestroyAutoReleasePool();
Calling the CreateAutoReleasePool() function marks the beginning of the auto-release block, and calling the DestroyAutoReleasePool() function marks the end. Any object allocated between these two calls is released by calling DestroyAutoReleasePool(). Using these two functions, you can write ActionScript code and not worry about memory management.
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/fireworks/8/fwextending/fw_03_17.htm