If you have only one instance of the object A then you can use with
statement or object's name:
with objA
{
sprite_index = YourSprite;
}
or
objA.sprite_index = YourSprite;
It won't work when you have more than one instance of the object A (then all instances will be changed). In this case you can use the name of the instance (press RMB on the instance in the room editor and select Copy Instance Name
(also you can rename it). Then code will be like this:
inst_FD70AA4D.sprite_index = YourSprite;
or
inst_YourName.sprite_index = YourSprite;
There are couple examples:
using instance's creation code (if you don't understand what it is, check the documentation (see Creation Code
).
using automatic creation
I made it lot time ago in GM8, you can just import them to GMS.