Game Development Reference
In-Depth Information
Figure 4.3 The base class can
be set to use a class for
multiple symbols with different
assets.
name like you would any other. For instance, if I had a document
class for the previous example, it might look something like the
following:
package {
import flash.display.Sprite;
public class ClassesExample extends Sprite {
public function ClassesExample() {
var blue:Square = new squareBlue();
addChild(blue);
var green:Square = new squareGreen();
addChild(green);
}
}
}
You can use it like a normal class because when Flash compiles
the SWF, it will be a normal class, just as though you
'
d written it
yourself.
Search Nedrilad ::




Custom Search