I just realized why I came up with so much problem in learning as3. I just understood that I had not completely understand the concept of class system.
now i know that for easiness, everything has a class. a movie clip class would look like this:
I also happened to know that a document class would look something very similar to movieclip class because it is also a subclass of flash.display.MovieClip.Code:package {
import flash.display.MovieClip;
public class MOVIECLIP extends MovieClip {
var ALL_COMMON_VARIAbLES;
function ALL_COMMON_FUNCTIONS() {
}
}
}
}
If something is wrong with my understanding, please tell me.
What is incomplete from my understanding is where should I put my:
I know that the FUNCTION_CALLED could be MOVIECLIP.ALL_COMMON_FUNCTIONCode:EVENT_CALLER.addEventListener(THE_EVENT,FUNCTION_CALLED)
.and sometimes I want my EVENT_CALLER to be stage, however stage, root, this, parent syntax cannot be used under package.
specific examples are:
1. code which i wish to be performed when the an instance of a movieclip is created. which previously is under OnClipEvent(load) written under the MovieClip in AS2
2. an enterframe event which should not belong under any movieclip.
so far my solution is to make a new movieclip called controller. but I know that it is a bad practice. so I am here in the rough way of trial and error to learn for a better coding logic.
thank you in advance. and learning AS3 is like learning a whole new language.
