Page 1 of 1

Passing complex data to flash with Flash PlayerControl

Posted: Wed Jan 24, 2007 11:23 pm
by vzhukov
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

Posted: Thu Jan 25, 2007 12:18 am
by Softanics
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.

Thanks !!!!

Posted: Thu Jan 25, 2007 12:38 pm
by vzhukov
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

Re: Thanks !!!!

Posted: Thu Jan 25, 2007 5:12 pm
by Softanics
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.

Posted: Fri Feb 09, 2007 10:12 pm
by ryan
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.