Hi guys, I have a problem with a piece of code which functions properly when first run it but when I run it the second time flash becomes unresponsive and crashes. I have tried the swf in flash player the code runs fine first few times but gets extremely slow thereafter.

I don't see anything in the code you show that looks like a cause for the problem. Usually things slowing down is the result of a loop constantly running and creating new objects that have to be processed continuously.