Ok. Your problem is that the instance of the object is not within the scope of the function. Basically, the only variables that a function can see are the ones passed to it and the ones it creates. So, you either need to pass the object to the function:
function my_function ($instance_of_class) {
// code
}
OR, you can declare the instance of the class as global to the function:
function my_function () {
global $instance_of_class;
//code;
}
Hope that helps:
Chris King