I am using as3. Just a simple question. If I created a static method. say I decide to call on other methods within that static method. Do those methods I call on need to be static as well? what If I used some of the properties. Not to store data permanently, but just within that process. Do those properties need to be static ??
Yes. If anything is called
No, they do not. You can use any type of variable/method from within a static method, including, of course, local variables. However, there is no concept of "this" in a static method, since the method is not being executed on an instance, but on the class itself. Therefor, the following (inside a class declaration) is illegal:
The references to myInstanceVariable above are illegal because that variable is an instance variable, which is not accessible to the static method. Because static methods are not executed on an instance in the first place, the "this" special variable is not valid.
If you wanted to, you could keep a static reference to an instance, and execute methods on said instance. That's the key idea behind the common singleton pattern.
Here, the _INSTANCE variable can be referenced from the static method, because the variable itself is declared as static.
To avoid confusion, there are actually answers to both the questions you asked:
Do method calls within a static method need to be static? Li0liQ answered this.
Do variables used within a static method need to be static? richardolsson answered this.
To summarize, within a static method, you can only access static variables and methods EXCEPT if you define local variables within the scope of the static method.
It makes sense if you think about it a little, but it's not an entirely clear concept at first.