View Full Version : Need Alternative for enterFrame event (Causing Memory leak )

05-28-2009, 08:29 PM
I am facing a callBack lost issue ExternalInterface,what is happening is as soon as you hide Flex application by opening another application(any app) and then again you come back to your flex app , call back does not work , they are broken.I found following related jira for this.


To solve this issue , I am re-registering all callBacks on ENTER_FRAME event and issue appears to be solved but this is leading to memory leak.

Neither Activate nor FocusEvent.FOCUS_IN does serve my purpose , both required a mouse Clk before they dispached.

Workaroud for any of the above will solve my problem. I am wondering If there is any event which gets fired when I swich back to the flex app again.

My application is hosted as ActiveX control and I m calling callback from Dot Net application.


05-29-2009, 06:09 PM
You can run an onEnterFrame that uses a JS call to the browser window hosting your app and requests the window's outerWidth/Height dimensions. If the dimensions fall below 200 it's likely the window has been minimized. If the browser is minimized, then maximized again, then you can re-initialize your handlers. This may cause less of a memory leak then re-reging all your handlers every frame, but then again it may not.

You could also consider re-reging every third frame or something. This would at least cut the script down considerably.