Detect connection speed and redirect

Hi all

How can I build a script in Flash that detects the users connection speed and then redirect him/her to appropriate content?

Cheers Jonas