Accessing proxy objects

If you want to access a proxy object outside of an auto-release block, you must use the RemoveFromAutoReleasePool() function. The RemoveFromAutoReleasePool() function manually removes an object reference from the auto-release pool before exiting the auto-release block.

In this example, the reference to the object defined as selObject is removed:

RPCMethods.CreateAutoReleasePool();
   var selObject = fw.selection.get(0);
   RPCMethods.RemoveFromAutoReleasePool(selObject);
RPCMethods.DestroyAutoReleasePool();

Now you can use the selObject object outside the auto-release block.

Note: You must remember to release the selObject object when you are done with it.

Additionally, you can nest auto-release blocks, that is, you can create an auto-release block and then call a function that creates its own auto-release block. The ReleaseObject() function iterates through an object's properties and releases any proxy objects it finds.


 

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_18.htm