Jump to content
Search Community

ChzBoi

Members
  • Posts

    5
  • Joined

  • Last visited

ChzBoi's Achievements

0

Reputation

  1. {EDIT: How and to whom do I contact about an old account. I had to make a new user for the forums in order to post this. I see no email link to an "Admin@greensock.com".} I am having issues with handles leaking in a VideoLoader. I made a test swf that loads external flvs and plays them in a loop. Over time, the memory and handles will rise, then garbage collection will run - the memory will come down, but the handles will continue to rise. If I compile with my "old" NetConnection/NetStream code, it will play back fine and the memory/handles will not budge. I am assuming I am missing something basic in the VideoLoader. Here is the VideoLoader code: public function StartVideo(WhichType:Number){ trace("<%BW%> StartVideo>"+WhichType); // var tmpstring:String="Win"+WhichType; var tmpfullstring:String="_Game/Bonus/_flvs/"+tmpstring+".flv"; if(IsStandAlone){ tmpfullstring="_flvs/"+tmpstring+".flv"; } //create a VideoLoader bigwinvideo = new VideoLoader(tmpfullstring, {name:"VID", container:VIDBASE,visible:true,x:-640,y:-720, width:1280, height:720,repeat:tmprepeat, scaleMode:"proportionalInside", autoPlay:false, volume:0}); //start loading bigwinvideo.load(); bigwinvideo.addEventListener(VideoLoader.VIDEO_COMPLETE, VidDoneCheck); bigwinvideo.playVideo(); } private function VidDoneCheck(event:Event) { trace("<%BW%> VidDoneCheck"); // event.target.removeEventListener(VideoLoader.VIDEO_COMPLETE, VidDoneCheck); //all off RESET(); } public function RESET(){ trace("<%BW%> RESET"); bigwinvideo.dispose(true); testINC++ if(testINC>=3){ testINC=0; } TweenMax.delayedCall(1, StartVideo,[testINC]); } And here is the NetConnection/NetStream code: public function BW_HD_Tester_alt() { trace("<%BW%> BW_HD_Tester_alt"); // var pType:String=String(Capabilities.playerType); if (pType=="External") { //swf is running in the Flash IDE preview player //need to activate those classes once in the swf LoaderMax.activate([VideoLoader]); // CreateBWTestBTNS(); } else if (pType=="StandAlone") { //swf is running in a standalone Flash Player LoaderMax.activate([VideoLoader]); // CreateBWTestBTNS(); } else if (pType == "PlugIn" || pType == "ActiveX") { //if it is local or on the web, but not using any web settings, then it's the PLATFORM } else if (pType == "Desktop") { //swf is running in a desktop AIR application } VIDBASE = new MovieClip(); VIDBASE.name="VIDBASE"; VIDBASE.x=320; VIDBASE.y=360; this.addChild(VIDBASE); // nc=new NetConnection(); nc.connect(null); ns=new NetStream(nc); ns.client=this; ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // bigwinvideo=new Video(1280,720); VIDBASE.addChild(bigwinvideo); bigwinvideo.attachNetStream(ns); // } public function StartVideo(WhichType:Number){ trace("<%BW%> StartVideo>"+WhichType); // var tmpstring:String="Win"+WhichType; var tmpfullstring:String="_Game/Bonus/_flvs/"+tmpstring+".flv"; if(IsStandAlone){ tmpfullstring="_flvs/"+tmpstring+".flv"; } ns.play(tmpfullstring); } public function onMetaData(infoObject:Object):void{ if(infoObject.duration != null){ trace("our video is "+infoObject.duration+" seconds long"); } if(infoObject.height != null && infoObject.width != null){ trace("our video is "+infoObject.width+"x"+infoObject.height+" pixels"); } } public function onXMPData(infoObject:Object):void{ } private function netStatusHandler(evt:NetStatusEvent):void { trace("netStatusHandler>>"+evt.info.code); if (evt.info.code == "NetStream.Play.Stop") { // do loop... RESET(); } } public function RESET(){ trace("<%BW%> RESET"); testINC++ if(testINC>=3){ testINC=0; } TweenMax.delayedCall(1, StartVideo,[testINC]); } Any comments or suggestions are appreciated! Mark
  2. I still get the lockup, not as severe, in the standalone as well as FireFox and IE. I think my fix will be to put in timers between large external swf loads, so it will appear that the 'hourglass' is moving - just only between the large files. (NOTE: this is for an self contained application and not for the web, so I am not that concerned about large files - it will all be local.) Thank you for looking into this for me. If you hear of a better way to load large ext swfs, let me know! Cheeze
  3. Hello again Mr. Schooff - thanks for the reply! Yes, using smaller sized external swfs will lessen the 'lockup' time. At around 4MB is when I start to notice it on a single file. I've attached a zip file, which has my test fla and the 'hourglass' swf. All you would need is an external "BigSWF2.swf" of 4+MB to complete. [if you want my full files, I uploaded another zip 12MB in total ("_TEST_FULL.zip") to http://www.fungistudios.com/LoaderMax/_TEST_FULL.zip] All I want is for the 1st loaded swf to continue to loop through it's animation once the 2nd loader starts loading the bigger swf. I must be missing some flag/var somewhere! Thank you again for help!! Cheeze
  4. Thank you for the reply Carl! I hardcoded the urls in an attempt to remove the xml for the chain - to see if that resolved the issue. I know small files work fine - any lock/delay happens much too fast to notice. In the end, the larger files are what I would need to work with. Regarding an upload of files, the above AS3 code is all there is. Not sure if you want my 1mb and 12mb files: they are a 10 frame, 130x130 png sequence and a 60 frame, 800x600 png sequence (respectively) - no code on either. I should say this, I was able to do this in AS2. So I must be missing something really simple! (can't see the forest for the trees)
  5. Hello GS folks. I would like to do the following: Create 2 loading queues. In Q1, load a small external swf that will loop a few frames (say like an "hourglass") to show loading is proceeding. In Q2, I would load a larger external swf in the background. Simple. However, as I've been trying this, my "hourglass" animation will lock/freeze until the Q2 has finished loading. Also, the entire Flash IDE will lock. I've made a very simple xml and script to test this. XML: <?xml version="1.0" encoding="iso-8859-1"?> SCRIPT: import com.greensock.*; import com.greensock.easing.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.*; import com.greensock.loading.display.*; import com.greensock.plugins.*; // LoaderMax.activate([imageLoader, SWFLoader, VideoLoader]); var loader:XMLLoader = new XMLLoader("data.xml", {name:"xmlData",onComplete:completeHandler}); loader.load(); // var TT:Timer = new Timer(2000, 1); TT.addEventListener("timer", TT_LoadQueue); // //var queue2:LoaderMax; var Queue:LoaderMax = new LoaderMax({name:"Queue", onComplete:QUEUEcompleteHandler}); var Queue2:LoaderMax = new LoaderMax({name:"Queue2", onComplete:QUEUE2completeHandler}); // function completeHandler(event:LoaderEvent):void { trace("XML and queue1 loaded! "+ LoaderMax.getContent("xmlData")); Queue.append(new SWFLoader("assets/SmSWF.swf", {name:"hourglass"})); Queue.load(); //start a timer to make sure hourglass is actually playing TT.start(); } function TT_LoadQueue(event:TimerEvent) { trace("TT_LoadQueue"); Queue2.append(new SWFLoader("assets/BigSWF.swf", {name:"base"})); Queue2.load(); } // function QUEUEcompleteHandler(event:LoaderEvent):void { trace("QUEUEcompleteHandler complete"); var HourGlass:ContentDisplay = LoaderMax.getContent("hourglass"); addChild(HourGlass); trace(event.target + " is complete!"); } function QUEUE2completeHandler(event:LoaderEvent):void { trace("QUEUE2completeHandler complete"); var BASE:ContentDisplay = LoaderMax.getContent("base"); addChild(BASE); trace(event.target + " is complete!"); } (All you need is an asset folder with 2 swfs in it - I am using a 1MB file for the "hourglass" and a 12MB for the "base") (I also had the progressHandlers in there, but the traces would not show up either, due to the Flash IDE lock.) I've double-checked to make sure my swfs are AS3 files and looked over the LoaderMax docs for a prop I might be missing. There is probably a very simple answer to this; something I've overlooked in haste. Any advice/comments are welcome. Many thanks - Cheeze
×
×
  • Create New...