# Database code decode

**URL:** <https://forum.kirupa.com/t/database-code-decode/188256>\
**Category:** Uncategorized\
**Created:** [May 5, 2006, 6:43pm UTC](https://forum.kirupa.com/t/database-code-decode/188256 "2006-05-05T18:43:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonoda](https://avatars.discourse-cdn.com/v4/letter/j/db5fbb/32.png) [@jasonoda](https://forum.kirupa.com/u/jasonoda)\
**Post date:** [May 5, 2006, 6:43pm UTC](https://forum.kirupa.com/t/database-code-decode/188256/1 "2006-05-05T18:43:36Z")

</div>

I’m working on an advergame with a high score board. My tech guy gave me this and I have no idea how to implement it. I just need to know:

1. what to put on the button that submits the score
2. what variables to assign to text boxes to display the high scores

Also, why do I get tons of errors when I check this? Is this normal for AS2? or is this code totally useless?

```auto

//This code can be directly copied and pasted onto frame 1 and should work 
//practically as is. Obviously this is not recommended practice but it should 
//give you a head start

import mx.remoting.*;
import mx.rpc.*;
import mx.utils.Delegate;
import mx.remoting.debug.NetDebug;

//Change the gateway URL as needed
var gatewayUrl:String = "http://2003.pepsi.stg.dal.tribalddb.com/amfphp/gateway.php";

NetDebug.initialize();
service = new Service(gatewayUrl, null, "MotorolaGame");
    
    
//Save game score under user's account.
function saveGameScore(Array, Array, Array)
{
    var pc:PendingCall = service.saveGameScore(user_name, score, user_id);
    pc.responder = new RelayResponder(this, "handleSaveGameScore", null);
}
    
//Get top score list including user_nm, score, and achievement date.
function getGameTopScorerList(Array)
{
    var pc:PendingCall = service.getGameTopScorerList(num_entries);
    pc.responder = new RelayResponder(this, "handleGetGameTopScorerList", null);
}
    
//returns method table contents
function getMethodTable()
{
    var pc:PendingCall = service.getMethodTable();
    pc.responder = new RelayResponder(this, "han dleGetMethodTable", null);
}
    

function handleSaveGameScore(re:ResultEvent)
{
    //Implement custom callback code
}

function handleGetGameTopScorerList(re:ResultEvent)
{
    //Implement custom callback code
}

function handleGetMethodTable(re:ResultEvent)
{
    //Implement custom callback code
}

```
