I have some frames in my pages and I dont want use ID of them because they generate automaticaly

so how can I send the index of frames to a function for using like this :

Code:
function myFunc(indx){
.
.
.
myObj = window.frames[indx] ;
.
.
.
}