Your code return the root nodes collection only.
Here's the modified code that gets all treeview nodes (including child nodes).
function iterateTree()
{
var treeview = CFlyTreeView.getInstanceById(\"\");
if (treeview instanceof CFlyTreeView)
{
var nodes = treeview.getNodes()
alert(nodes.length);
// get all nodes recursive using criteria function that returns true
// for every node
var allNodes = treeview.findAll(function(matchNode) {return true;});
alert(allNodes.length);
}
}