Page 2 of 2

Posted: Sat Mar 29, 2008 11:41 am
by Softanics
Searisen wrote:I'm using...

Code: Select all

    AnsiString XML = "<point><x>25</x><y>-50</y></point>";
    FlashPlayerControl1->SetVariable("XML_String",XML);
    FlashPlayerControl1->CallFunction("BorlandDoCommand");


If this is the right method, I'm getting unable to find FLASHPLAYERCONTROL.PAS


You should add the path to \FlashPlayerControl\Builder5\ dir to Project Options -> Directories/Conditionals -> Include path.

Also, this call is incorrect:

Code: Select all

FlashPlayerControl1->CallFunction("BorlandDoCommand");


You should write something like that:

Code: Select all

WideString Response = FlashPlayerControl1->CallFunction("<invoke name="CallMeFromApplication" returntype="xml"><arguments><string>Some text for TFlashPlayerControl</string></arguments></invoke>");

Posted: Sun Mar 30, 2008 1:27 am
by Searisen
I tried Sample7_ExternalInterface

I still get this runtime error

Source File Not Found: FlashPlayerControl.PAS

Here is my code:

Code: Select all

    WideString Response;
    AnsiString XML = "<invoke name=\"ExternalInterfaceCall\" returntype=\"xml\">";
    XML += "<arguments><string>Some text from us to Flash</string></arguments>";
    XML += "</invoke>";

    Response = FlashPlayerControl1->CallFunction( XML );


    ShowMessage("The function returned: " + Response);



I have a question about what the actionscript should look like, this is what I have.

Code: Select all

         public function ExternalInterfaceCall
         (
            inXML:XML
         )
         :XML
         {
            return XML("<string>Call Successful</string>");
         }


Is that what it should look like?

Posted: Sun Mar 30, 2008 7:41 pm
by Softanics
Searisen wrote:I tried Sample7_ExternalInterface

I still get this runtime error


runtime error or compile error?

Searisen wrote:Source File Not Found: FlashPlayerControl.PAS


Have you added the path to \FlashPlayerControl\Builder5\ dir to Project Options -> Directories/Conditionals -> Include path ?

Posted: Mon Mar 31, 2008 5:25 am
by Searisen
Yes, runtime error. Only happens when I click the application button (not flash button), so I can send data from Builder to Flash.

I double checked your demo zip file:
http://www.f-in-box.com/download/FlashP ... Delphi.zip

There is no FlashPlayerControl.PAS included with it. Is this intentional?

Posted: Mon Mar 31, 2008 8:14 am
by Softanics
Searisen wrote:Yes, runtime error. Only happens when I click the application button (not flash button), so I can send data from Builder to Flash.


Could you please send me this EXE to support (at) f-in-box.com

Also, please check Project -> Options -> Packages -> checkbox "Build with runtime packages" should be unchecked.

Searisen wrote:I double checked your demo zip file:
http://www.f-in-box.com/download/FlashP ... Delphi.zip

There is no FlashPlayerControl.PAS included with it. Is this intentional?


Yes, it's not included because it's a source code of the component. But applications built with the demo version should work properly without this file.

Posted: Mon Mar 31, 2008 4:21 pm
by Searisen
Everything is already this way.

Zip file link sent.

Posted: Wed Apr 09, 2008 6:18 pm
by Searisen
For those reading this: The problem I was having with the requirement for FlashPlayerControl.PAS during runtime, was at the very start of the application. In fact before the SWF file was running.

Since I am using Flex, In an the Application tag using creationComplete property, I set a function to call fscommand() to my C++ Builder program to notify it that the flash program was up and running. I wouldn't permit any communication to Flash from Builder until I received this notification, setting a global variable in builder to mark that communication was now permissible.

I hope that others running into this runtime error benefit from this knowledge.

All the demos I've seen wait for user interaction before sending data, thus they never show code of waiting for the flash player to load and run the flash program.