RSS

AS3 Object Oriented Programming

Actionscript 3 | Posted on May 18 2012

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");
        }
    }
}

Test the code on the first keyframe on the main Timeline:

import com.adobe.ooas3.Brick;
var firstBrick:Brick = new Brick();

Post a Comment