I have a bunch of Flex pages I need to convert to get rid of the flash player and have been unable to see how to replicate this code just using the javascript.
The Flex code gathers up data and sends it in a POST to a Cold Fusion page in another frame (named FrameData). Cold Fusion accesses the data from a FORM variable (FORM.mydata1, FORM.mydata2, etc.).
var RequestSite:URLRequest;
OutputPageValues.OutputType = 5;
OutputPageValues.mydata1 = "2";
OutputPageValues.mydata2 = "test";
RequestSite = new URLRequest("pageurl.cfm"));
RequestSite.data = OutputPageValues;
RequestSite.method = URLRequestMethod.POST;
navigateToURL(RequestSite, 'FrameData');
How do I emulate this construct in Royale? Is there another way to do this?
equivalente code for
URLRequest:in Apache Royale is
BrowserWindow:To pass variables you need to do via
GETmethod:"http://domain.foo?variable=" + key.To use
POSTmethod useHTTPServiceclass fromNetworkSWC instead:Optionally in case you need to deal with CORS you can add
CORSCredentialsBeadbead to theHTTPService:(Note: code is untested, please report if all is ok so we can improve this response and code snippet, thanks)