as2:CS2-help! Find last frame of loaded swf that loads flv file

How do you detect the end of the loaded swf that loads the flv?
It never reaches the frame 20, and I think it is due to the loaded flv CamTest.flv file. So how do you find out that the loaded swf really reached the end? How do you find out the end of the loaded flv inside the loaded swf? Thank you very much

On mainline frame 1, I have
loader_mc.loadMovie(“CamTest_controller.swf”);

On the loader_mc movie clip

onClipEvent (enterFrame) {
if (_root.loader_mc._currentframe == _root.loader_mc._totalframes && _root.loader_mc._currentframe>5) {
myTimer = _global.setTimeout(gotoNextFrame, 5000);
}
trace(‘cur frame=’+_root.loader_mc._currentframe+’ total frame=’+_root.loader_mc._totalframes);

function gotoNextFrame() {
    if (_root.loader_mc._currentframe == _root.loader_mc._totalframes) {
        _root.gotoAndStop(2);
    }
}

}

onClipEvent (load) {
trace(“on load clip event”);
for (obj in _root.loader_mc) {
trace(“Type:”+typeof (_root.loader_mc[obj]));
trace(“Name:”+_root.loader_mc[obj]._name);
}
trace(‘cur frame=’+_root.loader_mc._currentframe+’ total frame= '+_root.loader_mc._totalframes);
}

The output trace file has the following.

on load clip event
cur frame=1 total frame= 1
cur frame=1 total frame=1
cur frame=0 total frame=0
on load clip event
Type:function
Name:undefined
Type:movieclip
Name:background
cur frame=1 total frame= 20
cur frame=1 total frame=20
cur frame=2 total frame=20
cur frame=5 total frame=20
cur frame=11 total frame=20
cur frame=12 total frame=20
cur frame=13 total frame=20
cur frame=14 total frame=20
cur frame=15 total frame=20
undefined
m_fLastFrameTime : 220.493076923077
TOCStyleManager.styleTree called
100
100
loadFileRequest w/ a NULL fileIndex
*************loading Files: 0 ***************
loadFiles: CamTest.flv
loadFiles: CamTest_PIP.flv
First run: true

fileLoadFinished called***
cur frame=16 total frame=20
cur frame=16 total frame=20
cur frame=16 total frame=20
cur frame=16 total frame=20
cur frame=16 total frame=20


cur frame=16 total frame=20