A file found in a source-path can not have more than one externally visible definition.
What it means in my case was that I had code outside of the class but inside the package. Look at the code below.
Actionscript:
-
package com.test.managers
-
{
-
-
public interface IMyInterface
-
{
-
-
}
-
-
// these should be inside the brackets above
-
public var width:String;
-
public var height:String;
-
public var x:int;
-
public var y:int;
-
public var url:String;
-
public var htmlText:String;
-
-
}
A simple mistake. When I put the declarations inside the class code where it was supposed to go the error message resolved.
I also ran into this when I tried to add a utility class inside a package. This is the correct way to add it:
Actionscript:
-
package com.package
-
{
-
public class MyClass()
-
{
-
}
-
}
-
-
internal class Utility
-
{
-
public function Utility()
-
{
-
}
-
}
Please reply in the comments below if this helped you or not
Thanks for the help Judah.
This definitely helped me out.
I probably would have spent a lot of time trying to figure out something much more complex and of course in the end it was really simple!
Thanks for taking the time to post this :)
Thanks, it was really helpful :-)
Perhaps the compiler needs more clear, more self-explaining error messages.
Wow, Judah, thanks a million. This really helped me out a lot. Happy new year!
Thanks a lot for writing up this example/fix.
Looks like it will also be thrown if you don't define constructors for your classes inside. Happy new year.
UAAA!!!
I love you!
Thanx!
Applied for me too!
oh sh..t!
you saved me again!
mine is a fish memory...
Thanks a million for this Judah, I couldn't figure what was going wrong and had been pulling my hair out for the past hour ;-)
Legend!
Thank you for posting stuff like that! My hero!
Thanks for posting the solution, I had no idea what I did wrong.
This is really helpful... Thanks a lot for this post..
Daaaaaaamn!!!
Thank you sooooo mutch!
awesome!!!!!!!!!!
worked for me 2
thank you!
But class Utility can not extends any class
The error will also occur when you will write the private class into the package area.
I mean...
package
{
public class abc
{
}
class xyz
{
}
}
The right way is....
package
{
public class abc
{
}
}
class xyz
{
}
Thanks Sir I was wondering why this problem is coming and I got this solution.
Thanks again
Asadullah