Action Script: Important Notes
August 5, 2008 12:08 am UncategorizedIn this example I want to make an instance of the object GenericObject() that is contained in the ‘generic.as’ file.
You will start by including the .as file that contains the class myGenericObject();
#include “Generic.as”;
1. To include this in your .fla file you need to use the ‘new’ command in Actionscript.
var myGenericObject:GenericObject = new GenericObject();
2. You can make a movieClip instance a member of a class by right-clicking it in your library and selecting “Linkage…”. Once the window is open select “Export for Actionscript” and enter in the class name in the input field labeled “AS 2.0 Class:”. Click “OK” and now your movieClip will be a member of that class.
Use “instance of”to indicate whether your object is a instance of a class.
trace (myGenericObject instance of GenericObject); // yeilds true
