next up previous contents
Next: Methods Up: FFish Script Objects Reference Previous: test   Contents

ActiveXObject Object

Description

Enables and returns a reference to an ActiveX object.

available: SWFKit, SWFKit Pro


Syntax

new ActiveXObject(class | clsid | path)


Parameters

class
This parameter uses the syntax server.type, the meaning of each part is:
server
The name of the application providing the object.
type
The type or class of the object to create.
clsid
The CLSID of the object to create
path
Full path and name of the file containing the object to retrieve.


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




Subsections
next up previous contents
Next: Methods Up: FFish Script Objects Reference Previous: test   Contents
Copyright ©2000-2007 Shanghai TopCMM Software Technologies. All Rights Reserved.