Passing complex data to flash with Flash PlayerControl

.NET Edition of the F-IN-BOX
vzhukov
Posts: 6
Joined: Thu Nov 30, 2006 2:38 pm

Passing complex data to flash with Flash PlayerControl

Postby vzhukov » Wed Jan 24, 2007 11:23 pm

Hello !
Can you please help with that issue ?
I need to pass array or other complex structure into flash throught FlashPlayerControl with the only use of the FLASH-ability to parse function arguments in XML manner. This action should be performed only from .NET ActionScript functions calling mechanism. For instance, I call function 'function Test(arr:Array):String' with this:

<invoke name="Test" returntype="xml"><arguments><array><id>121212</id><name>NNN</name></array></arguments></invoke>

I really expect flash parser to perform some actions, like:

var arr:Array = new Array();
arr.id = "121212";
arr.name = "NNN";

The result of this call is 'undefined'.

Can I perform this action with the help of such function call string or there is another way to implement such functionality ?

With Best Regards
Vladimir

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

Postby Softanics » Thu Jan 25, 2007 12:18 am

Thank you for your question.

Some useful information you can find here:
http://www.mail-archive.com/osflash@osf ... 01355.html

Try

Code: Select all

<array><property id='0'><string>121212<string></property><property
id='1'><string>NNN</string></property></array>


instead of

Code: Select all

<array><id>121212</id><name>NNN</name></array>


I havent' tested it, hope it works.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

vzhukov
Posts: 6
Joined: Thu Nov 30, 2006 2:38 pm

Thanks !!!!

Postby vzhukov » Thu Jan 25, 2007 12:38 pm

Thanks a lot !!! This example works great !

<invoke name=\"Test\" returntype=\"xml\"><arguments><array><property id='EventId'><string>111<string></property></array></arguments></invoke>

and inside flash I can retrieve value with:

function Test(arr: Array):String
{
return arr.EventId; //(EventId = 111)
}

//***********
Is there any limitations relatively to string length that I pass into
this._flashPlayerControl.FlashMethod_CallFunction ?

With Best Regards
Vladimir

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

Re: Thanks !!!!

Postby Softanics » Thu Jan 25, 2007 5:12 pm

vzhukov wrote:Is there any limitations relatively to string length that I pass into
this._flashPlayerControl.FlashMethod_CallFunction ?


As soon as I know, the flash documentation doesn't contain any information about the limitations.
Best regards, Artem A. Razin,

F-IN-BOX support

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

ryan
Posts: 4
Joined: Thu Aug 10, 2006 5:19 pm

Postby ryan » Fri Feb 09, 2007 10:12 pm

vzhukov -

I have experienced problems when pumping very large xml strings (say around 10kb) through ExternalInterface/CallFunction. I found that the performance begins to degrade very quickly for large amounts of data and you would start seeing the "script is running slowly" dialog. Our solution was to use FSCommand/SetVariable for such situations.


Return to “.NET Edition”

Who is online

Users browsing this forum: No registered users and 11 guests

cron