Let’s use the code from the first section of this website. I don’t see a class declaration, and my program cannot be built in FlashDevelop. I receive the following error message:
Error: A file found in a source-path must have an externally visible definition. If a definition in the file is meant to be externally visible, please put the definition in a package.
Build halted with errors (fcsh).
What should I do in order to be able to build & run it?
If you’re using flash develop and pure AS3 (no flex) then everything has to be in a class and package.
Simply wrap that code in a custom class to use it in flashDevelop. If you create a new project in flash develop most templates create a Main.as file – which is the root class that runs when you’re project loads, just dump the code inside the Main class defined in that .AS file (except for the imports, they’ll need to be inbetween the package and class declarations).