Jump to content


  • Posts

  • Joined

  • Last visited


0 Newbie
  1. I used Flex as3 code to load and unload the pages. I had problems with loading/unloading swf pages. The Garbage Collector doesn't remove the object from memory, if the loaded asset (child swf) has event listeners, or loaded an asset. If you are using away3d or something similar you need to unload all children from it too. So to fix this problem, I created killEvents() function inside of each loaded child swf. Inside of each swf I unload all loaded assets, kill all event listeners, kill all sounds. I tried to change the names. You might need to look online to see what others are suggesting function killEvents() { try { ChildSwf.Button.removeEventListener(MouseEvent.MOUSE_UP, childSwfButtonListener); //Killing events that parent element is listening } catch (error:Error) { } try { ChildSwf.kill(); //Calling kill function inside the child swf } catch (e:Error) { debugTxt('ERROR in removeLoader(), calling kill().'); } try { ParentSWFLoader.unloadAndStop(true); //unloading } catch (e:Error) { debugTxt('ERROR in removeLoader(), calling unloadAndStop.'); } try { ParentSWFLoader.source = null; } catch (e:Error) { debugTxt('ERROR in removeLoader(), calling unloadAndStop.'); } SoundMixer.stopAll(); THe code below is suggested to use to clear the swfloader try { new LocalConnection().connect('foo'); new LocalConnection().connect('foo'); } catch (e:*) { } System.gc(); System.gc(); removeTimer() }
  2. Hello Flash CC project loads away3d. var loader:SWFLoader = new SWFLoader(path, {name:"mainSWF", container:this, x:50, y:100}); loader.load(); I am trying to load awa3d file into flex using LoaderMax. Swf is loaded correctly, but away3d doesn't play. How to use SWFLoader in flex project? Thanks Aki