Hi,
If the page loaded in the Iframe is not on the same domain as the page holding the frame you will get the Access denied error. This is a security measure implemented by browers. You can't work around this (not that I know of).
So mainpage is:
www.somedomain.com/index.html
Iframe src is:
www.otherdomain.com/page.html
Then you can ask for url, call events etc.
You can only access properties and events of iframe pages if they are on the same domain.