When function is finished

Hi guys,

I don’t know if I will explain this properly, but here goes: I have a function:

function toDo(){
           do this......
           do something else.... 
           do something else.....

When this function is finished doing everything it has to do, I want something else to be done for instance, gotoAndPlay(), but only when everything inside the function is done.

Thnx in advance.