Can i assign vars to an object on the fly?

more specifically: if i have an input box on the stage, can i assign it a variable via an event (let’s say a button click)?

something like:

myInputBox.var = variable1;
myInputBox.var = variable2;

PS i know the .var doesn’t exist btw (-: - it depits what i’m trying to achieve