Fixed up so it will run in an air app compiled for iOS and Android.