Using variables to tell AS to edit an instance

Is there a way to have a function draw a box around an object by finding the objects instance name via a string?

such as:

function BoxObject(object) {
//code to draw a box around the object
}

and then juts have an object with an instance name, like “my_mc” and then call the function on a keyframe like:

BoxObject(“my_mc”);