Jump to content
GreenSock

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

ukmikeb

Members
  • Posts

    11
  • Joined

  • Last visited

ukmikeb's Achievements

0

Reputation

  1. Great, thanks.. I realise some of the questions were probably frustratingly n00b! Still getting my head around the hierarchy and capabilities of the great LoaderMax.. Cheers!
  2. Further update... Adding autoDispose:true means children & queue being liberated from memory!!! Hooray! _queue.append(new DataLoader(_itemURLS[i], {name:"item_"+i, format:"binary", autoDispose:true}) ); Out of interest, in what case would you not want autoDispose:true? and how do you "manually" dispose of individual DataLoaders in a queue? If I have set autoDispose:true, does these mean I can no longer gain access to the content? thanks..
  3. OK a quick follow up to my last message.. It would appear that Flash/AIR is not the best at Garbage Collection. My tests tell me that you need to call system.gc() (upto) twice to get it to kick in. You also need do this a frame apart, so you need to set up an ENTER_FRAME event to handle these multiple garbage collection requests. Ref: http://www.craftymind.com/2008/04/09/kick-starting-the-garbage-collector-in-actionscript-3-with-air/ However, now that is sorted there does seem to still be an issue with removing items from the queue individually and freeing up memory. If I just let the entire queue complete and call GC as above.. no problem. However, I don't want memory in the queue to get out of hand so, I am saving to disk & killing queue items as they complete: function queueChildComplete(event:LoaderEvent):void { saveToDisk(); event.target.unload(); _queue.remove(event.target as LoaderCore); requestGC(); // garbage collection (as above) } I then go on to try and remove what remains of the queue with: private function queueComplete(event:LoaderEvent):void { _queue.dispose(true); requestGC(); // garbage collection (as above) } Now, I am not actually saving to disk yet, and just testing the theory of queuing, downloading & removing. Is it possible that I should also wait a frame before trying to remove an item from the queue? I of course can't be sure how long the writing to disk process will take, as I imagine if a file exists for example, saving will be instant. Any thoughts on queue item removal would be great. Thanks, and hope the garbage collection info may be of some use...
  4. Hi, Thanks fro responding over the weekend.. OK, so dispose(true) I will do that, thanks! As far as holding a reference to the content goes, I don't think I am as currently I am just downloading & then immediately disposing of the content (my NEXT step is to save the content to disk, but have yet to add that). So, is it possible that the fact that I am immediately disposing of the content while the queue is still running, could be upsetting things? I will try some cleaner simpler tests myself. Thanks for your guidance anyway.
  5. Hi, Just need to sanity check what I am doing and get best advice on clearing loadermax queue (and contents) from memory. So, I am using a LoaderMax queue in Air to download & store locally a series of assets (images, videos, pdfs). _queue.append(new DataLoader(itemURL, {name:itemID, format:"binary", estimatedBytes:_estBytes_general, autoDispose:true}) ); I should say at this point I am not yet doing the saving to local filesystem (so that is not influencing memory) So, Potentially I may have 100's of MB of files which may kill the app if I wait until the end of the queue. So as a queue "child" loads in, I am (going to) save to file, then I kill of the child & it's contents. I also call garbage collection at this point (Air only). function queueChildComplete(event:LoaderEvent):void { event.target.unload(); _queue.remove(event.target as LoaderCore); System.gc(); } When the entire queue completes, I then call the following to clear the queue from memory (not that their should be anything in there anymore). _queue.unload(); _queue.dispose(true) _queue.empty(true,true); System.gc(); Don't think I need to be calling all of those unload, dispose & empty.. but you know belt & braces! Now the problem is, when I trace System.privateMemory before (just before queue.load) & after the operation, memory has increased by the size of the files downloaded. 1) What is the text book method of disposing of a queue, and it's contents .. totally from memory (knowing that I will have re instantiate it later). 2) Do you have a handy tool that will stream files directly to the local filesystem for AIR apps (using urlstream perhaps). Many Thanks
  6. Hi Greensock, I have a site that has sperate MC with their own Classes. Within these classes I have imported and used you LoaderMax tools for loading images in (a) and videos in (. However, when I come to load the Video and put it on stage I am getting: Type Coercion failed: cannot convert com.greensock.loading::ImageLoader@2a128ce1 to com.greensock.loading.VideoLoader. Now if I remove MC (a) then MC ( loads and shows the video just fine. I'm sure I've screwed something up somewhere, but i'm wondering why there would be this 'corss-talk' betweeen classes? Are we 'allowed' to have more than one loadermax queue running in the FLA. Any insight may be useful, Thanks Mike
  7. LoaderEvent.FAIL is what i'm looking for and that documentation will help a lot. Thanks for your perspective.. hopefully now I can work out what is going on.. Thanks again! Mike
  8. Also...I am loading many assets (12 large FLV, 24 small PNG). Am I correct in seeing many errors appearing while it is trying to get the pngs, but can't because the FLVs are loading. All the assets are loading eventually, but the loader is throwing many errors along the way. Just trying to understand what qualifies as an error... I there a setting for FATAL .. absolutely can't get an asset type failure? (Should I be opening more 'connections'? If so, what are the implications of this? Thanks Mike
  9. Hi, Is there a complete list of error codes/messages for video loading. I am trying to do different things depending on the error. For example: 1) If loader fails to load file -> Fatal! 2) If loader fails to load Mets -> Not so bad! Cheers Mike
  10. Great!!! Thanks soo much for your quick reply.. So i've done this, and it seems to be working a treat! var videoLdr:VideoLoader = LoaderMax.getLoader("v_1"); trace("duration:" + videoLdr.duration) var videoContent:ContentDisplay = LoaderMax.getContent("v_1"); addChild(videoContent); videoLdr.addEventListener(VideoLoader.VIDEO_COMPLETE, videoCompleteHandler); videoLdr.playVideo(); function videoCompleteHandler(event:LoaderEvent):void { trace("finished playing VideoLoader: " + event.target); } Thanks Again.. awesome support! Mike
  11. Hi, You loaderMax tools are awesome, but I can't seem to find any examples for what I need.. and I am urgently in need of them !!! I have loaded a set of assets using: public var queue:LoaderMax = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler}); and within a loop added the assets to the queue: queue.append( new VideoLoader(vURL, {name:"v_"+i, estimatedBytes:2350000}) ); queue.append( new ImageLoader(vThumbURL, {name:"vThumb_"+i, estimatedBytes:8500}) ); queue.append( new ImageLoader(vMapURL, {name:"vMap_"+i, estimatedBytes:3000}) ); started loading: queue.load(); then when the completes it's load, i'm displaying the video, no problem: var video:ContentDisplay = LoaderMax.getContent("v_1"); addChild(video); NOW.. THIS IS WHERE I AM LOST: 1) How do access the properties of the video: like VIDEO_COMPLETE (so I know when it's finished) & others 2) how do I control the playback: playVideo() etc... Nothing I try seems to be working?? I am guessing using ContentDisplay won't allow me these functions, but not sure how else to play the videos in my queue? Please help! (quickly if possible ) Thanks Mike
×