Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

growch

Members
  • Posts

    5
  • Joined

  • Last visited

growch's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Thanks for the response - makes sense. Was hoping somebody might have run across similar issue and found a fix. I'm hoping there is something that can be detected after flash.events.Event.UNLOAD is dispatched which indicates the content is definitely unloaded. Will investigate with Adobe.
  2. Hello, I'm trying to figure out the proper way to detect the unloading of a swf loaded with SWFLoader. My app is an AIR/iOS app that behaves differently on the device vs testing locally in Flash Builder. When viewing the console in debug I see this in Flash Builder: 1) [sWF] assets/swfs/common.Page1.swf - 808,976 bytes after decompression 2) [unload SWF] assets/swfs/common.Page1.swf 3) [sWF] assets/swfs/common.Page2.swf - 969,002 bytes after decompression However, looking at the debug console when testing on an iPad 1, I don't always see 2). It only appears after going to Page3. So sometimes a swf seems stuck in memory. The ViewController function for adding pages is basically: 1) destroy, remove and nullify a "_currentPage" page it if already exists 2) garbage collect (System.gc() twice) 3) check to see if LoaderEvent.UNLOAD event has fired. if not, call same function again after slight delay My question is if there is some other event that should be listened for to detect when the swf is truly unloaded? i.e. whatever actually happens in the Flash Player that displays this in the console: [unload SWF] assets/swfs/common.PageNameHere.swf Hopefully this issue makes sense. Thanks in advance for any help. Best, Mark
  3. Hello again, Update on this issue. Here is a list of things that caused my swfs to NOT unload. * not flushing the content of the loader after unload i.e. _loader.dispose(true); * not nullifying private vars referencing Objects i.e. MovieClips in the asset * setTimeouts that didn't fire - fixed with TweenMax delayed calls that got killed before leaving page i.e. TweenMax.killAll(); * having fonts embedded in library - think this would be considered bytecode which is not allowed in loaded swfs * 1 stop() action on any frame. same explanation as previous Hopefully, this helps someone else in a similar situation.
  4. Hmmm, thanks for the response and info. The insight is appreciated. This is frustrating. If I find any more info or a workaround, I will let you know.
  5. Hello, I'm working on an AIR/iOS app and was having some issues with the unloading of swfs that are loaded via SWFLoader. Basically, each page aka view of my app has a local reference to the class below. public function SWFAssetLoader(thisSWF:String, thisContainer:MovieClip) { _loader = new SWFLoader("app:/assets/swfs/"+thisSWF+".swf", {container:thisContainer, noCache:true, context:DataModel.LoadContext, onInit:initLoadedSWF}); _loader.load(); } private function initLoadedSWF(event:LoaderEvent):void { assetMC = _loader.getSWFChild("mc_mc") as MovieClip; EventController.getInstance().dispatchEvent(new ViewEvent(ViewEvent.ASSET_LOADED)); } public function destroy():void { _loader.unload(); _loader.dispose(true); _loader = null; } I have a ViewController class that loads each view. Before a new view is added, the current view's destroy method is called which calls the above destroy method. However, according to the Console in Flash Builder, the swfs aren't getting unloaded. Or at least not when needed. It seems to happen arbitrarily. When I run the app for example I'll see this in the console: [sWF] assets/swfs/Page1.swf [sWF] assets/swfs/Page2.swf [sWF] assets/swfs/Page3.swf [unload SWF] assets/swfs/Page1.swf It should function above that Page1 gets loaded, and when selecting Page2, before it gets loaded, Page1 should unload through the unload() method which is being called. It's not behaving that way. Shouldn't the SWFLoader unload() method be seen in the Console log if it is working as it should? The thing is, depending on what page I start on, it will unload different swfs at different times. A guess to what's happening is when the app starts running out of memory, it unloads swfs as needed. Unfortunately, this causes the app to crash on the iPad. Hope this makes sense. Any ideas? Thanks in advance for any help. -Mark
×