Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-21-2006, 01:40 AM
Member
 
Join Date: Sep 2006
Posts: 38
Default Setting up FLEX to run FFish script?

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

Reply With Quote
  #2 (permalink)  
Old 09-22-2006, 06:21 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Setting up FLEX to run FFish script?

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:

Reply With Quote
  #3 (permalink)  
Old 09-22-2006, 06:22 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Setting up FLEX to run FFish script?

The "getFileName" script in the swfkit v3:
Reply With Quote
  #4 (permalink)  
Old 09-22-2006, 06:26 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Setting up FLEX to run FFish script?

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.
Reply With Quote
  #5 (permalink)  
Old 09-22-2006, 06:28 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Setting up FLEX to run FFish script?

Soon we will provide ffish script objects wrapper classes for actionscript 3, which can be called directly in flash 9 and flex 2.
Reply With Quote
  #6 (permalink)  
Old 09-22-2006, 03:29 PM
Member
 
Join Date: Sep 2006
Posts: 38
Default Re:Setting up FLEX to run FFish script?

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.
Reply With Quote
  #7 (permalink)  
Old 09-25-2006, 08:24 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Setting up FLEX to run FFish script?

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);
}
}
}
Reply With Quote
  #8 (permalink)  
Old 09-25-2006, 08:25 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Setting up FLEX to run FFish script?

The dialogs class
Code:
package SWFKit {
public dynamic class Dialogs extends BaseObj {
public function Dialogs() {
super("Dialogs");
}
}
}
Reply With Quote
  #9 (permalink)  
Old 09-25-2006, 08:27 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Setting up FLEX to run FFish script?

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>
Reply With Quote
  #10 (permalink)  
Old 10-18-2006, 10:20 PM
Member
 
Join Date: Sep 2006
Posts: 38
Default Re:Setting up FLEX to run FFish script?

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

Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:53 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.