I've never worked with Flex, but I assume you have to download a special AIR SDK with Flex inside and Flex should be imported from there.
In IDEA, first of all install Flash plugin in case you haven't already.
Then check if your AIR Flex SDK is selected in File -> Project Structure -> Project and especially in File -> Project Structure -> Modules -> Dependencies tab and that should do the trick.
Also you can check if at the bottom right of IDEA app your project module that you've created at File -> Project Structure -> Modules is selected.
To use specific Animate CC classes (it seems you do not use them for now, but just in case for the future), you might include .........CreativeCloud/Adobe Animate 2023/Adobe Animate 2023.app/Contents/Common/Configuration/ActionScript 3.0/libs/flash.swc
As of EventDispatcher, maybe your code is inside a class that inherits Flash MovieClip or Sprite, who themselves are inherited from flash EventDispatcher, so it has a priority over Starlings.
Hope that helps.