OK, to clarify I have an NGUI button which on click opens a filebrowser. I have code to upload the image selected from the filebrowser as the avatar of the player and then save it to local disk so that it can then be set as the image for the button that was clicked.
I was trying to do this :
ProfilePicButton.maintexture = Resources.Load ("/avatar.png") as Texture;
Where ProfilePicButton has been referenced beforehand. I tried changing the type to various different things without success.
It seems to me from your replies that I might have to add the image somehow to the atlas and set it as a sprite? Is there a more direct approach I can take?