Description
Enables and returns a reference to an ActiveX object.
available: SWFKit, SWFKit Pro
Syntax
new ActiveXObject(class | clsid | path)
Parameters
Returns
If Succeed, returns a new instance of the ActiveXObject object that represents a reference to the corresponding ActiveX object. You can access any properties, methods and evens of the ActiveX object with the new instance. If failed, return null.
Remarks
You can access properties, methods and evens exposed by the ActiveX object just as invoke a method provides by any FFish Script Objects. Don't worry about the details of COM interfaces, Variable types. FFish Script checks and converts variable types automatically. FFish Script supports ActiveX object events. Events are methods defined in the outgoing interfaces of the ActiveX objects used to notify its client of events. You can define an event handling function and set to the event you care about. FFish Script Engine calls the function when the ActiveX object fires the event. FFish Script also provides two static methods register and unregister to register or unregister an ActiveX object.
Examples
//Example1 - create an ActiveXObject by specified a class name
word = new ActiveXObject("word.application");
word.Visible = true;
trace(word.Visible);
word.Documents.Add();
word.Selection.TypeText("This is a test...");
word.Documents[1].SaveAs("c:\\test.doc");
word.Quit();
//Example2 - create an ActivexObjext from file
doc = new ActiveXObject("c:\\test.doc");
doc.SaveAs("c:\\test1.doc");