Error 1046: Type was not found or was not a compile-time constant: Event.
Getting this error in ActionScript 3?
Error 1046: Type was not found or was not a compile-time constant: Event.
You need to import the Event class:
import flash.events.Event;
This is one of the most common AS3 errors, especially when you’re starting out. Unlike AS2, ActionScript 3 requires you to explicitly import classes before using them. The compiler won’t automatically resolve types from the flash package.
The same error applies to other event types too — if you’re using MouseEvent, KeyboardEvent, TimerEvent, etc., you need to import each one. A quick way to avoid this is to import the entire events package: import flash.events.*, though importing specific classes is generally better practice.