AS3 Object Oriented Programming
A basic ActionScript 3 Object-Oriented Programming Reference:
The Colour.as code below illustrates one of the most basic implementations of an ActionScript 3.0 class. The class holds just a single method and property.
package com.custom.colour
{
public class Colour
{
public var color:String = "red";
public function Colour()
{
trace("new "+ color +" created");
}
}
}
{
public class Colour
{
public var color:String = "red";
public function Colour()
{
trace("new "+ color +" created");
}
}
}
Test the code on the first keyframe on the main Timeline:
import com.adobe.ooas3.Brick;
var firstBrick:Brick = new Brick();
var firstBrick:Brick = new Brick();
