Jump to content
GreenSock

jc74

Members
  • Posts

    5
  • Joined

  • Last visited

jc74's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I sent you a link to download the flas. Please check your pm. Thanks a lot!! Much appreciated!!
  2. loading works great, but the memory issues didn't go away. Memory just keeps on climbing as I navigate through the app. Even I set the oldLoader and oldPage to null, the previous swfs will just stay in the memory. Here is my modified code, it is basically the same except I added: oldLoader = null; removeChild(oldPage); oldPage = null; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import flash.display.*; var prevLevel:* = this.parent; var currentPage:MovieClip; var oldPage:MovieClip; var bgID:String; var curLoader:SWFLoader; var oldLoader:SWFLoader; function startLoad(txt:String):void { bgID = txt; loadPage("flash/" + bgID + ".swf"); } function loadPage(txt:String):void { var loader:SWFLoader = new SWFLoader(txt, {onComplete:loadCompleted}); loader.load(); trace(txt); } function loadCompleted(e:LoaderEvent):void { oldPage = currentPage; currentPage = e.target.rawContent as MovieClip; oldLoader = curLoader; curLoader = e.target as SWFLoader; if (oldLoader) { oldLoader.dispose(true); oldLoader = null; removeChild(oldPage); oldPage = null; } if (currentPage) { while (this.numChildren) { this.removeChildAt(0); } addChild(currentPage); prevLevel.slideOffStage(); } } And this is the code I have on the external swf. There is no stage Listener or whatsoever, tweenMax is the only code I used. stop(); import com.greensock.*; import com.greensock.easing.*; var delayTimer:Number = 0.25; TweenMax.to(rendering, 1, {x:-805.45, delay:delayTimer, ease:Expo.easeOut}); TweenMax.to(clear_mc, 1, {x:106.9, delay:delayTimer, ease:Expo.easeOut}); TweenMax.to(header, 1.25, {x:-381, delay:delayTimer + 0.25, ease:Expo.easeOut}); TweenMax.to(txt, 1, {x:288.8, delay:delayTimer + 0.35, ease:Expo.easeOut}); I am really hitting the wall here.... I have absolutely no idea on how to clear out those external swfs from the memory. Any idea why it isn't working? Bugs in the flash player? That said, I am still really grateful for all the help your provided here, greensock. Thanks!
  3. oh wow! Thank you so much for answering all my questions and fixing the code for me, greensock!! I will try it out tomorrow and hopefully it will resolve the memory issues with my application!
  4. I believe I did. here is the code that I wrote.... By the way, how can I use loaderMax to achieve the same thing? var prevLevel:* = this.parent; var currentPage:MovieClip; var oldPage:MovieClip; var bgID:String; function startLoad(txt:String):void { var page:String=txt; bgID=page; var url:String="flash/"+page+".swf"; var loader:Loader=new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleted); loadPage(url); function loadPage(txt:String):void { var pgeName:String=txt; loader.load(new URLRequest(pgeName)); trace(pgeName); } function loadCompleted(e:Event):void { loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, loadCompleted); oldPage=currentPage; currentPage=loader.content as MovieClip; loader.unloadAndStop(); if (oldPage) { removeChild(oldPage); oldPage=null; } if (currentPage) { while (this.numChildren) { this.removeChildAt(0); } addChild(currentPage); prevLevel.slideOffStage(); } } }
  5. Hi all, I have developed a touchscreen application that works perfectly fine except for the memory issue. Basically, the touchscreen app works kinda like a website with navgation on the side and content displaying next to it. I separeate each section into external swfs, and load each one up when it is needed, thinking it would reduce memory usage on the pc. But unlike actionscript 2, AS 3 would not remove the external swfs from the memory. You can remove it from the stage and you won't see it, but the swf will still stay in the memory! So... as you navigate through the app, loading up all these external swf, even I do loader.unloadAndStop();, the swf is still there, and they just keep stacking up in the memory as you navigate through the app. After leaving the touchscreen for a day or 2, having all these users naviage through it, all the external swfs will just completely consume all the resources and freeze the pc. I have been googling for a day, and still can't find a solution. I hope someone here could point me into a direction to have this issue resolved, and it will be greatly appreciated. Would using loadermax solve the problem? Also, is it better to develop touchscreen application with actionscript 2 since it doesn't have this pressing memory issue? Any help appreciated, thanks!
×