/ Published in: ActionScript 3
This code is taken from David Stiller's post on the CommunityMX website. All credit goes to him.
URL: http://www.communitymx.com/content/article.cfm?cid=8F0CA
URL: http://www.communitymx.com/content/article.cfm?cid=8F0CA