I could have done something a lot cleaner but it's only supported in AS >= 4.0