| Previous | Next | |
Windows: Flash 8 or 9 AS2.0 SWF + mProjector
3.0; Windows 98/ME/NT Support: Flash 7 SWF + mProjector
2.0;
Macintosh: Not Applicable
mApplication.createObject(classId:String) : ObjectclassId - A string containing the object class id.
An object.; ; Returns a COM object, exposing most of its methods and properties.
Method; Creates the specified COM object. When no longer needed, the object should be destroyed using the deleteObject() method. When specifying the classId, either the object class name or class id can be used.
Both COM object methods and properties can be accessed through ActionScript. Simple properties, such as the EOF property of the Recordset object in the above example, can be accessed directly. However, the array properties such as the Fields collection in the above example have to be accessed via the getProperty function, and set via the setProperty function.
The following example creates a COM object, calls one of its methods, and deletes it when finished. Note that, when no longer needed, each COM object should be explicitly deleted using its deleteObject() method.
var c = NULL;
c = mApplication.createObject("Foo.dll");
if (c)
{
c.doSomething();
c.deleteObject();
c = NULL;
}
mApplication.registerCOMServer()
Windows COM Basics, Windows COM MS Access Database
| Questions or Feedback? | Previous | Next |