Skip to main content
Participant
April 17, 2025
Question

How do I make this method post in html5 canvas.

  • April 17, 2025
  • 1 reply
  • 147 views

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
April 17, 2025

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

 

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