-
1. Re: How to create a "package wide" variable?
Gregory Lafrance Jul 29, 2009 8:19 AM (in response to NewFlasherFromKS)I think if you have no access modifier (public, private, protected), it defaults to package access.
If this post answers your question or helps, please mark it as such.
-
2. Re: How to create a "package wide" variable?
NewFlasherFromKS Jul 29, 2009 10:05 AM (in response to Gregory Lafrance)Hi Greg,
Greg Lafrance wrote:
I think if you have no access modifier (public, private, protected), it defaults to package access.
that's what I read. But the code below fails - and it doesn't matter whether I say 'internal var thingies' or just 'var thingies'.
package components {
import flash.display.Sprite;
internal var thingies:Array = new Array(); // this should become my 'shared' variable
public class DrawGrid extends Sprite {}
}
Does maybe the error message ring a bell? Maybe it would work if the file were not on the source path?
A file found in a source-path can not have more than one externally visible definition.
I wouldn't mind moving my file - if I knew how I could still use my classes.
Any more ideas?
Best regards
Helmut
-
3. Re: How to create a "package wide" variable?
Gregory Lafrance Jul 29, 2009 10:33 AM (in response to NewFlasherFromKS)1 person found this helpfulI've never seen the error. Very strange.
-
4. Re: How to create a "package wide" variable?
NewFlasherFromKS Jul 29, 2009 12:37 PM (in response to Gregory Lafrance)Greg Lafrance wrote:
I've never seen the error. Very strange.
Hi Greg,
now this _is_ a helpful answer: it kind of restores my sanity.
After copying all kind of examples and getting this error I kind of worried.
Well, maybe my installation is broken? the German version is not quite up to the original? there exists an update I am missing?
Oh, I know the reason: It's the trial version
Ok, a new trace to pursue.
Best regards
Helmut
-
5. Re: How to create a "package wide" variable?
Gregory Lafrance Jul 29, 2009 1:11 PM (in response to NewFlasherFromKS)This page indicates the variable should be in the class (and that works for your test code):
http://www.judahfrangipane.com/blog/?p=60
If this post answered your question or helped, please mark it as such.
-
6. Re: How to create a "package wide" variable?
NewFlasherFromKS Jul 30, 2009 3:23 AM (in response to Gregory Lafrance)Hi Greg,
back here again.
Well, the link you gave says "Put the definition into the class".
Sure, then the error is gone - but then it is a local definition in this class and not accessible from other classes in the package - hence still no 'package wide' variable.
Strange - ok, I am new to AS but I wonder: How do you guys organize your data? I mean, I won't be the only one who needs to remember a thing or two - say for cleaning up purposes.
Thanks for your time and best regards
Helmut