This content has been marked as final. Show 6 replies
The class name must reflect the name of the file -- or vice-versa.
Either rename your file Main.as, or rename your class NoScale
Thanks. That cleared that error up however now I have another error with the compiler.
1046: Type was not found or was not a compile-time constant: MouseEvent.
When I do not link a class to this project, I get no compile errors whatsoever and my project works no problems.
When I link a class file to this project, I all of a sudden get a bunch of compile errors telling me that I do not have
I have figured out all compile errors except for the following:
1180: Call to a possibly undefined method LoaderInfo.
1120: Access of undefined property InterpolationMethod.
What class file or files do I have to link in order to get rid of these errors?
don't you know what your classes are doing? if you have a class that uses the loaderinfo class and is not subclassing a class that has access to that class you need to import import flash.display.LoaderInfo into that class. and if you're using beginGradientFill() or lineGradientStyle() you need to import flash.display.InterpolationMethod into that class.
I know that the classes are code that is prewritten so you can use the functions within.
The answer to your question is No, I don't know what the classes are doing because I am just beginning with AS3 and Flash 9.
However, my question is Why does my code work with no problems without importing any of those classes into the code when I don't put anything into the Document class: [ box ].
As soon as I wanted to give my flash header the ability to resize itself, I found out that I had to create a .as or class file with the above code in it to give it that capability. Once I did that I found out that I had to use the document class box in order to link that class file to the SWF. Once I created a proper .as file named NoScale and typed NoScale into the document class box, all of a sudden a ton of errors happen wanting me to include the flash.blah.blah files. If I remove the NoScale from the document class box and do nothing else, the project works just fine.
That is what I don't understand.
Adding the following did fix the errors. Thanks.
class files only import the classes that are explicity specified. your fla imports all the classes it needs without requiring anything to be explicitly imported.