Flickering Images: Caused by Not Preloaded Values?

This is a rather a simple, maybe, as a question. So when I was coding a sample menu, I found out that whenever I do use sprites as the command buttons and ran through them, the images flicker not until all of them kinda have been selected. My question is, is there a way to make this coded so all the resources seemingly there already?

First Question:

Are the resources preloaded? Why are my images flickering?

Second Question:

If so, is there a way in js to combat this, so I don't have to worry about flickering images at all? They seem to be in fact, for everything. When I coded a sample window (with the help of Kocka, btw), I found out that whenever I access the Window, the faces don't show quickly. Same goes if I go to the menu.
You need to give more info. In fact, we need to see your script.


Resources are preloaded if you tell them to preload. If they are not preloaded, I don't think "flickering" would be the result - I think it would not be there, and then (if you coded in a certain way) it would be there. It wouldn't flicker afterwards.


Faces ARE preloaded when you go to the menu, so that would not be the cause of the flickering.


I'd say it's got something to do with the way you've coded - or maybe another plugin that's causing problems.
Here's an example:

Spoiler
var commands = ["Item", "Skill", "Equip", "Formation", "Save", "End"];Scene_Menu.prototype.create = function() { Scene_MenuBase.prototype.create.call(this); this.createCommandWindow(); this.createGoldWindow(); this.createStatusWindow(); this.createCommandImages();};Scene_Menu.prototype.createCommandImages = function(){ this._commandSprite = new Sprite(); this.addChild(this._commandSprite);}Scene_Menu.prototype.update = function() { this._commandSprite.bitmap = ImageManager.loadPictures(commands[this._commandWindow._index]); Scene_MenuBase.prototype.update.call(this); } 
Normally, it works...its just that when you move them, the images flicker.
Yes, you have to preload the images on that case.
It still shouldn't make them 'flicker' (flicker is on/off/on/off/on/off) - once they're loaded, they're loaded and should no longer flicker, unless you have something that's clearing the cache on every frame.
There's none. When you try that it flickers. Say you have 7 commands. It flickers 7 times and after that it goes away.
ah, gotcha. Yes, if it's "flickering" once for each, and then no more, it's a preloading issue. If you can track down how it's done for faces, you'll be able to see how to do it for your sprites.
ah, gotcha. Yes, if it's "flickering" once for each, and then no more, it's a preloading issue. If you can track down how it's done for faces, you'll be able to see how to do it for your sprites.
Hey Shaz, I found out a way when I researched somewhere on Stackoverflow. <3

Though right now manually, you have to preload the specific image for it to work 😀
Sorry for intruding, but... How do I preload an Image?

Original thread: https://forums.rpgmakerweb.com/threads/flickering-images-caused-by-not-preloaded-values.52101/