How can I spend a XML for the C # for Flash / Flex and move back a XML Flash / Flex for the C #?
I need to make the communication of data between the C # and Flash / Flex.
danielgianni wrote:How can I spend a XML for the C # for Flash / Flex and move back a XML Flash / Flex for the C #?
I need to make the communication of data between the C # and Flash / Flex.
Code: Select all
var xml1:xml = new xml();
xml1.load("data.xml");
Code: Select all
private void OnLoadExternalResourceByRelativePath(object sender, string strRelativePath, Stream Stream, ref bool Handled)
{
if (strRelativePath == "data.xml")
{
Stream.Write(...); // write XML here
bHandled = true;
}
}
danielgianni wrote:But that applies to f-in-box? Sorry my question but i don't know.
danielgianni wrote:If I do not have the XML file, but I have only one XML structure in memory even if is possible the communication?
Code: Select all
var xml1:xml = new xml();
xml1.load("data.xml");
Code: Select all
private void OnLoadExternalResourceByRelativePath(object sender, string strRelativePath, Stream Stream, ref bool Handled)
{
if (strRelativePath == "data.xml")
{
Stream.Write(...); // write XML here
bHandled = true;
}
}
Code: Select all
Stream.Write(...); // write XML here
Code: Select all
import flash.external.ExternalInterface;
var myXML;
function GetXML()
{
myXML = ExternalInterface.call("GetXML");
}
function SendXML()
{
ExternalInterface.call("SendXML", "<string>Hello C#</string>");
}
Code: Select all
private XmlNodeList MyXmlList = new XmlNodeList();
private void FlashControl_OnFlashCall(object sender, string request)
{
XmlDocument FlashXMLDoc = new XmlDocument();
FlashXMLDoc.LoadXml(request);
string strCommand = FlashXMLDoc.GetElementsByTagName("invoke").Item(0).Attributes.GetNamedItem("name").Value;
XmlNodeList list = FlashXMLDoc.GetElementsByTagName("arguments");
if (strCommand == "GetXML")
{
String ReturnString = "<string>Hi Flash</string>"; // XML Data to send in this case just a string
FlashControl.FlashMethod_SetReturnValue(ReturnString); //Send the list to Flash
//MessageBox.Show(ReturnString);
}
if (strCommand == "SendXML")
{
MyXmlList = list;
}
}
Users browsing this forum: No registered users and 11 guests