all groups > macromedia flash flash remoting > april 2005 >
You're in the

macromedia flash flash remoting

group:

pass an array from C# to Flash


pass an array from C# to Flash Sintwar
4/11/2005 12:00:00 AM
macromedia flash flash remoting:
I am pulling my hair out here... I can very easily pass 1 variable at a time
from C# to Flash like this: C#: Flash.Result = whatever Flash: function
whateverCode_Result( result ) { myText = result; } probably about the
simplest thing I have ever coded. For some reason, I have tried every possible
method I can imagine, and then some to pass more than 1 variable at a time. I
have tried Array, ArrayList, HashTable, and a few other ideas. I have googled
this until I was blue in the face, only to find sparse or incomplete examples.
Nothing I try seems to work. I need some example code to work with, wether it
be using an Array or whatever it may be. I need the code from start to finish
for C# and Flash. Can anyone please help? Thank you for any help you can
give.
Re: pass an array from C# to Flash James Fee
4/12/2005 10:54:46 AM
Are you passing this via an open connection (XMLSocket or XML.load) or are
you setting flash variables on a web page?

If you are using an open connection, then XML is the way to go. Otherwise,
roll your own parser and don't use native C# objects.

I have flash projects that are on web pages that open connections back to a
server and just communicate with XML. I wrap the data on the server in XML,
then it is simple to unwrap in flash with it's XML objects.

--
Jim Fee
Viking Electronic Services
jfee (at) vikinges (dot) com


[quoted text, click to view]

Re: pass an array from C# to Flash Sintwar
4/13/2005 3:15:21 AM
actually I figured it out. I used an object and then called it like this in
Flash: myVar = result[0] myVar = result[1] I am actually sending data from
Flash to the C#, handling it, updating a SQL DB, all kinds of good stuff, and
then only returning 2 or 3 simple values. All of the logic is happening on the
server, so I am really just using the flash to display the leftovers from the
C# logic. I really don't have any experience with XML. I have just never
really needed to use it. Although I have created a few web services, I never
'really' messed with the XML portion of it. I wouldn't even know where to
begin.
Re: pass an array from C# to Flash? SabyGaba
8/24/2005 12:00:00 AM
Sintwar, My problem is quite similar to yours. I m retrieving some data from
the C# file as i stored in a ArrayList as :


<script langauge="C#" runat="server">
struct str
{
public int phone;
public string zip;
}
void Page_Load( Object sender, EventArgs e)
{
ArrayList arrTest = new ArrayList();
str s=new str();
s.zip="12345";
arrTest.add(s)

Flash.Result = arrTest;
}
</script>


In Flash,

res=result.

But it is not working,

Plz Help.
AddThis Social Bookmark Button