# \[AS2\] Submitting high score to remote server

**URL:** <https://forum.kirupa.com/t/as2-submitting-high-score-to-remote-server/300045>\
**Category:** flash\
**Created:** [November 15, 2009, 10:37am UTC](https://forum.kirupa.com/t/as2-submitting-high-score-to-remote-server/300045 "2009-11-15T10:37:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueSquid](https://avatars.discourse-cdn.com/v4/letter/b/d2c977/32.png) [@BlueSquid](https://forum.kirupa.com/u/BlueSquid)\
**Post date:** [November 15, 2009, 10:37am UTC](https://forum.kirupa.com/t/as2-submitting-high-score-to-remote-server/300045/1 "2009-11-15T10:37:18Z")

</div>

I am wanting to have a high score function at the end of my game. My code is generating a URL, but is then appending it with &onLoad=%5Btype%20Function%5D which is making it fail. If I past the code manually into a browser, removing &onLoad=%5Btype%20Function%5D from the end, it works perfectly.

The URL that is being created is:

http//www.webname.co.uk/RegisterScore.aspx?name=FlashTest&score=1001&code=99999&onLoad=%5Btype%20Function%5D

My code is:

System.security.loadPolicyFile(“C:\path…\crossdomain.xml”);  
var score:Number = 1001;  
var hsname:String = “FlashTest”;  
function addHighScore(returnFrame:String, name:String, score:Number, code:Number) {  
var hstGetUrl = "[http://www.webname/RegisterScore.aspx?";](http://www.webname/RegisterScore.aspx?%22;)  
var hstID = code;  
var lvSend:LoadVars = new LoadVars();  
lvSend.onLoad = function(success:Boolean) {  
if (success) {  
trace(“success”);  
gotoAndPlay(returnFrame);  
} else {  
trace(“failed”);  
gotoAndPlay(returnFrame);  
}  
};  
lvSend.code = hstID;  
[//lvSend.name](https://lvSend.name) = name;  
lvSend.score = score;  
lvSend.name = name;  
lvSend.sendAndLoad(hstGetUrl, lvSend, “POST”);  
trace (hstGetUrl + lvSend);  
stop();  
}  
addHighScore(“next”, hsname, score, 99999);
