I assume you mean .parentPage in the assignment line of your script.
In which case the alert shows me "[Page]" which is as it should be.
What version of InDesign?
Also, this construction:
var allTextFrames = new Array(); allTextFrames = myLayer.textFrames;
is both superfluous and unwise. You declare allTextFrames, initially assign it the value of the Array constructor, as if it were an array, and then you assign it to a collection.
In this case, simply
var allTextFrames = myLayer.textFrames;
would be sufficient.
What's the minimal document necessary to make your script fail?
Also, it would be nice to see an example that stands on its own.
This one depends on myLayer, so it's annoying for others to test.