It is possible to throw error at runtime with throw
.
throw new Error( "Error message!" );
Is it possible to throw errors or warnings at compile time from AS3 code?
No, it's not, unless you could somehow modify the compiler or write your own.
You can't write code to throw a compile-time error, that doesn't make sense.