next up previous contents
Next: Data exchanging between Action Up: Using FFish script objects Previous: Calling actionscript methods from   Contents

Remarks

The global functions of SWFKit are wrapped in the "SWFKit.Global" class. For example, the getAdditional file is a global method of SWFKit, in action script you should call it in the following form:
import SWFKit.*;
Global.getAdditionalFile("my.file");

To avoid conflicts, the Application.* object in SWFKit such as Application.Appreance, Application.dragdrop, etc are wrapped in SWFKit.application.* and Inet.Ftp object is wrapped in SWFKit.inet.Ftp.

Unlike the FFish scripting language, in which an instance of an object can call static methods or properties, the action script supports only to call a static method or property by using the class name. For example, the following code works,

import SWFKit.application.*;
dragdrop.enable = true;
whereas the following code does not work,
import SWFKit.application.*;
var dd = new dragdrop;
dd.enable = true;
However, if you want to set the event handler of an object, you must create an instance of the class and call the "setEventHandler" method.

Each wrapper class has a "Release" method that is used to delete the instances of the FFish script objects. Although the FFish script objects are created and accessed from within Action script, the instances of the objects are maintained in the FFish scripting language. In this case, the FFish scripting language does not know when you have finished using these instances of the objects, that is, the instances will be kept in memory unless you delete them explicitly. Hence, calling the "Release" method after you have finished using a FFish script object will save memory, especially if you have created a lot of FFish script objects in your flash movie. The instances of the objects will be released automatically when the output executable file exits even if you do not call the "Release" method.

import SWFKit.*;
var fs = new FileStream("c:\\demo.txt", "w");
...
...
fs.close();
fs.Release();

Some objects, such as Printer, Dll, PConn, etc, which are not suitable for calling directly in action script, or do not work by directly calling them in action script at all, are not wrapped.

If you have any problem with the wrapper classes, you can look into their source code to get help.


next up previous contents
Next: Data exchanging between Action Up: Using FFish script objects Previous: Calling actionscript methods from   Contents
Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.