Skip to main content
Participant
Apr 17, 2025 10:56 AM UTC
Question

How do I make this method post in html5 canvas.

function sendPontuacao(score):void {
var requestVars = new URLVariables();
requestVars.score = score;
var request = new URLRequest("/system/sendscore");
request.data = requestVars;
request.method = URLRequestMethod.POST;
try {
new URLLoader().load(request);
} catch (e:Error) {
trace(e);
}
}
this.sendPontuacao(1);

1 reply

Thom Parker
Community Expert
Community Expert
Apr 17, 2025 4:51 PM UTC

The Acrobat flavor of JavaScript is very different from the Browser JavaScript model. 

So, none of the code you've posted will run in Acrobat.

Here's a like to the Acrobat JavaScript Model documentation. 

https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/index.html

 

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often