-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Hi guys,
I'm using Flash CC 2015 publish a Html5 banner, open it on chrome for 30 minutes and the huge memory waste on my PC. I had tried to reproduce this problem on both chrome, firefox latest version and the same things.
Memory leak in 2 context:
- As you can see in Chrome task manager, memory still increase while the tab is in focus.

- Switching to another tab, the banner's still eating more memory.
I tried to add more 25 banners by loading into 25 iframes in a single page and final result memory was increased so fast.
To Fix it:
An workaround for context 2 by edit the publishing html file and adding some small function to listen "visibilitychange" event when user switch tab and stop the ticker when tab lost focus:
var isActive = true;
function onStopAnimation() {
createjs.Ticker.removeEventListener("tick", stage);
}
function onStartAnimation() {
if(isActive == true) {
createjs.Ticker.addEventListener("tick", stage);
}else {
onStopAnimation();
}
}
function handleVisibilityChange() {
if (document.hidden) {
isActive = false;
onStopAnimation();
} else {
isActive = true;
onStartAnimation();
}
}
document.addEventListener("visibilitychange", handleVisibilityChange, false);
For context 1, it looks like the ticker still running and redawn the object?
any tips for how to work around when we public html with flash cc 2015
Thanks,
Hoa
Metadata
Metadata
Assignees
Labels
No labels