|
|||
|
I see in the documentation how to setup FLASH to be able to use FFish Script directly within the Flash IDE.
However, I'm currently using FLEX Builder 2.0. CAn anyone point me to directions to be able to use FFish script directly within Flex for development? Thanks in Advance. Steve |
|
|||
|
The wrapper classes of ffish script objects are for only actionscript 2 at this time, so you cannot call them in Flex Builder 2. However, you can still call ffish scripts in the way shown in the following picture:
|
|
|||
|
In the way introduced above, the ffish scripts will be called synchronously.
In a word, using swfkit series v3 with flex builder 2 is very simple, just the following two steps: 1. in flex builder 2, use the ExternalInterface object to call ffish scripts. 2. add the swf movies built by flex builder 2 into the resource list of swfkit series 3, insert ffish scripts, and build the swfkit project. |
|
|||
|
Thanks for your reply. I'll add the workaround that you suggest, and get back to you with the results. In the meantime, I notice that you say that the new wrappers will be available 'very soon'.
Can you share an example of what needs to be changed in the wrappers? I only need a few classes, and I have no problem making some modifications myself once I know what you think needs to be changed. Best Regards. |
|
|||
|
The baseobj in actionscript 3
Code:
package SWFKit {
import flash.utils.Proxy;
import flash.utils.flash_proxy;
import flash.external.*;
public dynamic class BaseObj extends Proxy {
public var Identifier: Number;
public function BaseObj(objName:String) {
var ret:* = ExternalInterface.call("ffish_new", objName);
if (ret == null || ret == undefined) this.Identifier = 0;
else this.Identifier = ret;
}
override flash_proxy function callProperty(methodName:*, ... args):* {
return ExternalInterface.call("ffish_call2", this.Identifier,
String(methodName), args);
}
override flash_proxy function getProperty(name:*):* {
return ExternalInterface.call("ffish_getprop", this.Identifier,
name);
}
override flash_proxy function setProperty(name:*, value:*):void {
ExternalInterface.call("ffish_setprop", this.Identifier, name, value);
}
public function IsValid(): Boolean
{
return this.Identifier != 0;
}
public function Release(): void
{
ExternalInterface.call("ffish_delete", this.Identifier);
}
public function setEventHandler(event: String, handler:Function):void
{
var handlerName:String = "_" + this.Identifier + "_" + event;
ExternalInterface.addCallback(handlerName, handler);
ExternalInterface.call("ffish_seh", this.Identifier, event, handlerName);
}
}
}
|
|
|||
|
Call the Dialogs object in flex builder 2
Code:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Button x="180" y="286" label="Button" id="MyBtn" click="OnClickMyBtn()"/> <mx:Script> <![CDATA[ import SWFKit.*; private function OnClickMyBtn():void { var d:Dialogs = new Dialogs; d.msgBox("hello"); var filename:String = d.fileOpen("All Files(*.*)|*.*"); if (filename) { d.msgBox(filename); } } ]]> </mx:Script> </mx:Application> |
|
|||
|
I have a followup question. I've been able to call ffishScript directly via the "ExternalInterface" API, but I'm not sure how to handle stuff that requires access to GLOBAL.
For example, I want to set my window to MAXIMIZED, but I can't seem to get the "getMainWnd();" call to work correctly. Can you post an example? Do you have the AS3 version of the ffishScript wrappers complete? Best Regards, Steve |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|