How to modify a sprite from an object with function (without code)?

How do I…

Is there a way to copy an image to a 2Dsprite inside a function, the same you can pass an image to a particle emitter through function?
I know how to set the image ressource as function arguments, but I don’t know how to assign them to a sprite.

What is the expected result

I want to pass an image as argument to a function, and assign in to a sprite

What is the actual result

I can set my argument, but I cannot change the sprite image

Related screenshots

Resource parameters are Javascript only.
since we’re talking about sprites, the recommended way of making modular icon change is by importing the icons into the sprite as animations.so you can call’em by name later in events

This is only possible via JavaScript and won’t be animated with a new image through code.