Jump into another url if it enters a certain frame

Hello i was wandering if a flash website can jump into another url if it enters a certain frame…

For example maybe something like?

on enterFrame {
getURL(“http://www.sample.com/”, “_self”);
}

how do i tell the timeline to get that url instead of the button? Any ideas would be very helpful

thanks