-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
37 lines (31 loc) · 987 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
AS3 HTTPService
Description:
Mimics the mx.rpc.http.HTTPService class for AS3 Applications.
By using the flash.net.URLLoader & flash.net.URLRequest classes.
Example:
import com.net.http.HTTPService;
import com.net.rpc.events.ResultEvent;
import com.net.rpc.events.FaultEvent;
/**
* Complete handler
*/
function handleComplete(result:ResultEvent):void {
trace("Successfully loaded xml:");
trace(event.result);
}
/**
* Fault handler
*/
function handleFault(event:FaultEvent):void {
trace("Could not load xml");
trace(event.fault);
}
/* Initialize and set parameters*/
var url:String = 'http://example.com/destination';
var httpService:HTTPService = new HTTPService();
httpService.resultFormat = HTTPService.RESULT_FORMAT_XML;
/* Add Event listeners */
httpService.addEventListener(ResultEvent.RESULT, handleComplete);
httpService.addEventListener(FaultEvent.Fault, handleFault);
/* Send the request */
httpService.send({"key": "value"});