Articles Tagged 'static'

Actionscript 3.0 for beginners: lesson # 5

Who has started to develop code with scripting languages ​​such as JavaScript or ActionScript the same, may not know all the concept of data type. With some high-level languages, in fact, it used to - at best - to declare variables without giving a specific data type, not counting those languages ​​that do not require any statement (such as PHP - not in the strict version 5 ).

Continued ...

Actionscript 3.0 for beginners: lesson # 4

Recall the example of our code of TicTacToe (found in full on Google Code ) and begin to analyze it in detail.

Import definitions

With Actionscript 3.0 has done a great job of cleaning and accommodation nell'alberatura classes (contained in the packages, package ) used during development. In other programming languages, like C for example, when you want to use a feature must explicitly "import" in the code. This operation of "import" is necessary to allow the compiler to have all the codes and definitions related to the features we want to use. ; Actionscript 3.0 mette a disposizione l'istruzione include che è identica all' #include del C/C++. In ActionScript 3.0, however, education import should not be confused with the equivalent C / C + + #include , Actionscript 3.0 provides education include that is identical to ' #include in C / C + +. The latter, in fact, "include" the actual code that, if used or not, the final executable is compiled. The statement import is the highest level and is more "intelligent" at compile time. It is used primarily for access classes without specifying their full name. In alre words instead of using forms such as:

1
flash.display . MovieClip = new flash.display . MovieClip ( ) ; var myMC: flash.display. MovieClip = new flash.display. MovieClip ();

Continued ...

Write good OO code in Adobe Flash

Here are some tips on how to write good code Object Oriented (OO) in Adobe Flash, especially for those still using version MX waiting to go to CS3.

Organize classes folders

First of all, the organization of classes makes the job significantly easier code maintenance. You can also create a real library you can reuse in other projects. Flash uses a classification related to the filesystem, and then organizing them into folders will also be reflected on the import of classes. For example, if we create the sequence of folders "mylibrary / graphics / plot" and insert our own ActionScript class "PlotClass.as", when we should use to import the class:

1
grafica . plot . PlotClass ; mylibrary imports. graphics. plot. PlotClass;

If the library (folder) "MyLibrary" is not in your movie folder or project, use the Flash publish settings to select the path:

Setting percoroso libraries

Continued ...