This is my first tutorial in AS3.
The big change in AS2 and AS3 is Object Oriented Programming.
In AS3 all are considered as Object, Class. In this let me say What is Class ? , What is Object? , What is Package and their syntax.
Package:
Package is the collection of class. Class needs to be specified with in a package.
Syntax:
package
{
....
...
}
Class:
Class is the collection of function and variables.
Syntax:
{
...
...
}
type can be of 4 types : dynamic, final, internal, public where internal id default.
Object:
Object is the instance of class. Hear is the power of Object oriented programming by creating a single class we can create multiple objects.
var
Example with all package, class, object...
//sample.as
package
{
class sample
{
sample()
{
trace("Hi");
}
}
}
//main.fla
var my_obj:sample = new sample();
No comments:
Post a Comment