Script to detect when flash finish playing

Hello.

I’m in a jam and was wondering if anyone here can help me.

I am looking for a script (such as javascript) that is independant of flash that will detect when flash has finish playing.

This script will be coded in the html page somewhere.

Is there such a script?? Or does this have to be coded in the flash file itself??

Thanks in advance for your help.

Cheerio,

Chi.