Thanks Toritoribe.
By the way, at the back of my mind is a thought that this ~う/よう + に can be used with another meaning too, depending on context, though I can't remember what the meaning actually is. Is this right, or am I imagining it? (I mean ~う/よう as in the verb form; I'm not talking about the other ように meaning "in order to", "so that" or similar.)