How do you call a function in an iframe from outside?

How do you call a function in an iframe from outside?

I was wondering if there was a way in jQuery to call a function from within an iframe.

Is there another way of writing:

window.frame['myframe'][0].myFunction();

I tried:

$('#myframe').contents().find('iframe').contents().myFunction();

but this does not work.

Thanks for any help anyone can be.