Copy link to clipboard
Copied
Heya, I'm currently working in adobe animate to create and develop an app to be exported in android.
Okay, It's all fine, the app works very well and I can play at stable 60+ fps on my device (Galaxy Grand Prime). But, when I delete and add constantly elements it starts to lag up to a point it's impossible to play.
The only solution I found it's to close and re-open the application to "reset" the lag.
I also have been reading about garbage collector and how it works but my code it's built around GC.
I also check the use of RAM and it's not increasing, It keeps at less than 15mb of use.
I can't share code cuz I'm not at home right now, but, I can share my app (uplodaded on mega) and here are the steps to create lag:
1. When you open the app, just change between screens constantly and eventually it's going to be slowed the game.
Link to my app:
https://mega.nz/#!2DIRXSrK!TgdroZS3OPYkwvg5R2lYdm6QEmXXawtU445itB--QoY
This is what my app do when I switch screens:
0. I have a DocumentClass with public vars of my screens like:
public var menuScreen:MenuScreen;
public var playScreen: PlayScreen;
1. When It switchs to another screen, first tween out the screen the current screen.
2. Now it deletes the current screen listeners and the current screen with removeChild (). Next, it set the screen to delete to null like this:
removeMenuScreenListeners ();
removeChild(menuScreen);
menuScreen = null.
3. The new screen its added like this:
playScreen = new PlayScreen ();
addPlayScreenListeners ();
addChild(playScreen);
tweenIn (playScreen); // This is to create an animation.
If you know what can I do to fix this problem, please contact me via Facebook or here.
(My facebook is at About Creator Screen in the game).
Thanks for reading.
Pd: Maybe on monday I'll share the source code of my game.
The way you're working looks like it ought to work. I have had cases in the past when the system itself may need to be forced to garbage collect. Maybe that would help?
The AS3 would be: System.gc();
Copy link to clipboard
Copied
The way you're working looks like it ought to work. I have had cases in the past when the system itself may need to be forced to garbage collect. Maybe that would help?
The AS3 would be: System.gc();
Find more inspiration, events, and resources on the new Adobe Community
Explore Now