Function names are case sensitive so for starters you need
Code:
local frame = CreateFrame("Frame", "myframename", UIParent)
Secondly you can store your frames in a table for easy iteration but frames are tables themselves.
So you could just as well store the references to the children on the parent frame.
Code:
for i=1,5 do
frame.children = frame.children or {}
frame.children[i] = CreateFrame("Frame", "child"..i, frame) -- or your custom frame creation function
end
for _,child in ipairs(frame.children) do
-- manipulate the child frame
end