Builder 5 Demo

F-IN-BOX for Delphi / Builder C++ / VCL
Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Sat Mar 29, 2008 11:41 am

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>");
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

Searisen
Posts: 12
Joined: Wed Mar 26, 2008 9:36 pm

Postby Searisen » Sun Mar 30, 2008 1:27 am

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?
Chuck Savage
www.searisen.com

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Sun Mar 30, 2008 7:41 pm

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 ?
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Searisen
Posts: 12
Joined: Wed Mar 26, 2008 9:36 pm

Postby Searisen » Mon Mar 31, 2008 5:25 am

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?
Chuck Savage

www.searisen.com

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon Mar 31, 2008 8:14 am

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.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Searisen
Posts: 12
Joined: Wed Mar 26, 2008 9:36 pm

Postby Searisen » Mon Mar 31, 2008 4:21 pm

Everything is already this way.

Zip file link sent.
Chuck Savage

www.searisen.com

Searisen
Posts: 12
Joined: Wed Mar 26, 2008 9:36 pm

Postby Searisen » Wed Apr 09, 2008 6:18 pm

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.
Chuck Savage

www.searisen.com


Return to “Delphi / Builder / VCL Edition”

Who is online

Users browsing this forum: No registered users and 19 guests

cron