Jump to content
Search Community

Search the Community

Showing results for tags 'garbage collection'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

  • Learning Center
  • Blog

Categories

  • Products
  • Plugins

Categories

  • Examples
  • Showcase

Categories

  • FAQ

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Twitter


CodePen


Company Website


Location


Interests

Found 7 results

  1. Hi guys, I have a generall question while starting to use GSAP with barba. I wonder if someone of you could bring light into my JS-darkness at this early point. I am trying to find a solid basic setup with both of the libraries together. barba.init({ views: [{ namespace: 'home', afterEnter(data) { initTimeline1(data.next.container); initTimeline2(data.next.container); initTriggeredTween(data.next.container); }, }] }); const initTimeline1 = (next) => { const tl = gsap.timeline({}) .to(next.querySelector('el1'),{'GSAP MAGIC'}) return tl } const initTimeline2 = (next) => { const tl = gsap.timeline({scrollTrigger:{}}) .to(next.querySelector('el2'),{'GSAP MAGIC'}) return tl } const initTriggeredTween = (next) => { next.querySelector('el3').addEventListener('click', () => { gsap.to(next.querySelector('targetEl'),{'GSAP MAGIC'}) }) } barba.hooks.beforeEnter( () => { ScrollTrigger.getAll().forEach(trigger => { trigger.kill() }); ScrollTrigger.refresh(true) } ) I leaned so far, that I have to kill the ScrollTriggers, because things dont work, if I return to the page with namespace"home". But if I reinititate the timelines, tweens and events again and again I am wondering if I am causing a memory leaks. Do I have to kill, remove, destroy all of them manually or does the garbage collection take care of things by itself? And if I have to manage the things, are there similar support functions like ScrollTrigger.getAll() for helping me out? I just read, that killAll is deprecated. Sorry for my English, and the question which may be a little off topic. Many thanks in advance
  2. No need to worry. Tweens and timelines are automatically made eligible for garbage collection (gc) when appropriate (typically when they finish but if you maintain a reference to an instance so that you can restart it later, for example, it won’t be gc’d out from under you). Basically the system manages gc for you and generally cleans up after itself.
  3. Hello, I'm working on cleaning up some legacy code so it can be unloaded from the parent SWF and ran into an issue that when any TweenMax function is called within a child SWF (eg. TweenMax.killAll(), just that, nothing else is called), it blocks the child SWF from being unloaded. The same issue cannot be repeated when instead of TweenMax I use TweenLite or TweenNano. Using advanced telemetry Adobe Scout just shows that TweenLite initializers are not garbage collected. As a note, the parent SWF also uses TweenLite. The child SWFs are loaded into the parent in the same application domain and security domain using LoaderMax. I am using * VERSION: 12.0.0 * DATE: 2013-01-21 of TweenNano and * VERSION: 12.1.5, * DATE: 2014-07-19 of TweenMax (the latest package) Any ideas as to what might cause this are appreciated. I would upload the scout session files but those are ~14mb each, instead I can offer dropbox links: https://dl.dropboxusercontent.com/u/15108424/EvoWrapper/EvoWrapper-collected.flm https://dl.dropboxusercontent.com/u/15108424/EvoWrapper/EvoWrapper-notCollected.flm
  4. Is there any speed or Garbage Collection difference between TweenMax & TweenLite ? Actually currently i'm working on site in which i'm using more than 500 tween with TweenMax , and site works perfectly in firefox but in chrome and safari tween lag very badly. link of my demo page
  5. I'm trying to use exportRoot(); in an iOS app. If the app is in the background for a length of time, the timeline can no longer resume. Is it possible that the timeline is lost in garbage collection? My pause screen is still visible and the buttons are still available. But nothing resumes. If you leave and come back quickly it's fine. Anything I can try to make it hold the timeline for as long as the app is in the background? --- EDIT ---- Sorry, looks like I was calling the exportRoot twice and that was the source of my trouble.
  6. Hi, I was wondering if there is some kind of interaction happening that would prevent a deferred from being resolved in the onComplete event of TimelineLite? I have tried a bunch of things to get it to resolve, but it never does: passing in the object, having the deferred be a local variable in the outer scope, etc. I am basically trying to create an animation that occurs before a route change in angular.js. There is a mechanism whereby I can create a deferred and the routing waits until it is either resolved or rejected. The problem is that while it works fine in a timeout callback, it doesn't work in an onComplete callback of TimelineLite. Can anyeone shed any light on why that would be? I can provide some code if you need it.
  7. I'm having an issue loading loaders that have been loaded, then disposed of. Let me explain that (it gives me a headache trying to parse it). I have an array of loaders, some VideoLoaders, some ImageLoaders. I'm trying to make something where you can swipe through multiple objects, but rolled my own garbage collection so only three objects (previous, current, and next) are currently loaded into memory, as these files can get fairly large. I append a loader to my LoaderMax instance, then call the load() method. As I move forward through my array, I append the prev, current, and next loader based on my currentSlideIndex. I move forward two objects, then call loaderArray[currentSlideIndex-2].dispose(true) to unload the content of that particular loader. If I move backwards through the array, eventually, the first loader I appended will get appended to my LoaderMax instance a second time. LoaderMax doesn't seem to throw an error (although I don't believe I'm listening for one) and completes it's loading. When I try to access the content property, it is null. Any ideas how to load this content a second time or to change up my garbage collection? Here is some code to help explain it: var currentSlide:Sprite = new Sprite(); var previousSlide:Sprite = new Sprite(); var nextSlide:Sprite = new Sprite(); var currentSlideIndex:int = 0; var loaderArray:Array = new Array(); var presentationLoader:LoaderMax = new LoaderMax({onComplete:doneWithCurrentLoad}); loaderArray.push(new ImageLoader(url1, {name:"slide1", width:1920, height:1080})); loaderArray.push(new VideoLoader(url2, {name:"slide2", width:1920, height:1080, autoPlay:false})); loaderArray.push(new VideoLoader(url3, {name:"slide3", width:1920, height:1080, autoPlay:false})); loaderArray.push(new VideoLoader(url4, {name:"slide4", width:1920, height:1080, autoPlay:false})); loaderArray.push(new VideoLoader(url5, {name:"slide5", width:1920, height:1080, autoPlay:false})); loaderArray.push(new VideoLoader(url6, {name:"slide6", width:1920, height:1080, autoPlay:false})); presentationLoader.append(loaderArray[0]); presentationLoader.append(loaderArray[1]); presentationLoader.load(); function goForward():void { if(currentSlideIndex<loaderArray.length - 1) { currentSlideIndex++; //This is where problems happen the second time revisiting the content. thisSlide = loaderArray[currentSlideIndex].content; nextSlide.addChild(thisSlide); //Imagine transition code here rearangeSlides(1); } } function goBackward():void { if(currentSlideIndex>0) { currentSlideIndex--; thisSlide = loaderArray[currentSlideIndex].content; previousSlide.addChild(thisSlide); //Imagine transition code here rearangeSlides(-1); } } function rearangeSlides(param1:Number):void { var tempContent:ContentDisplay; if (param1 > 0) { //Going forward tempContent = ContentDisplay(nextSlide.getChildAt(0)); //Remove content two back, we want the immediately previous loader to keep content ready if (loaderArray[currentSlideIndex - 2] is VideoLoader) VideoLoader(loaderArray[currentSlideIndex - 2]).dispose(true); trace(loaderArray); if (currentSlide.numChildren > 0) currentSlide.removeChildAt(0); currentSlide.addChild(tempContent); currentSlide.x = 0; nextSlide.x = 1920; } else if (param1 < 0) { //Going backwards tempContent = ContentDisplay(previousSlide.getChildAt(0)); //Remove content two forward, we want the immediately next loader to keep content ready if (loaderArray[currentSlideIndex + 2] is VideoLoader) VideoLoader(loaderArray[currentSlideIndex + 2]).dispose(true); currentSlide.removeChildAt(0); currentSlide.addChild(previousSlide.getChildAt(0)); currentSlide.x = 0; previousSlide.x = -1920; } }
×
×
  • Create New...