Change gameobject sprite

I have read all about changing sprite image from resources but i think i m doing something wrong.

First of all i loaded new asset (image 200x200), then in Sprite Editor split that in four squares (renamed to: flag1, flag2, flag3, flag4).
Spritemode of image set to “multiple”. All applied.

In some moving box script i want to load part of the image i called flag1 when press for ex.RightArrow
(object called CUBE and script is attached to it, CUBE already had some image/sprite)

void CheckUserInput () {
if (Input.GetKeyDown(KeyCode.RightArrow)) {
transform.position = new Vector3(1,0,0);
Resources.Load(“flag1”);

nothing happened

Just to clarify, are you trying to change a sprite to another sprite in the sprite packer or are you trying to load a new sprite from the Resources folder?

I want to load new sprite from the Resources folder (game object/image *200x200 called flags, and separate sprites are flag1, flag2, flag3, flag4) *40x40

thx

Maybe you should do :
GetComponent().sprite = Resources.Load(“flag1”) as Sprite;

But i’m not sure I understood what you wanted.