dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: ArmorBot Top10 Code As3 Version ?

  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    77

    ArmorBot Top10 Code As3 Version ?

    Armotbot's top10 sample in as2.

    Code:
    /*
    Armor Bot Rankz
    TOP10 Internal Highscores Display
    Sample
    by Gabriel Ochsenhofer
    */
    rankz_t10_send = new LoadVars();
    rankz_t10_receive = new LoadVars();
    //replace those vars below with the provided
    rankz_t10_send.SU0249 = "MWolZSVhJW41cw";
    rankz_t10_send.flashkey = "UEFOQ0FLRVM";
    //
    rankz_t10_receive.onLoad = function(success) {
    	if (success) {
    		_rankz_ar_ = rankz_t10_receive.top10.split("<u/*/u>");
    		for (i=0; i<_rankz_ar_.length; i++) {
    			tempv = _rankz_ar_[i].split("</*/>");
    			_root["rankz_n"+(i+1)].text = tempv[0];
    			_root["rankz_v"+(i+1)].text = tempv[1];
    			//tempv[2] = NAME2 var
    			//tempv[3] = SCORE2 var
    			//tempv[4] = SCORE3 var
    		}
    	} else {
    		trace("ERROR");
    	}
    };
    rankz_t10_send.sendAndLoad("http://rankz.armorbot.com/get/top10.php", rankz_t10_receive, "POST");
    Can someone translate is to AS3?

  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    77
    I am going to use it in my new flash game. I need help.

  3. #3
    Junior Member
    Join Date
    Jul 2008
    Posts
    2

    Armor Bot AS 3.0 Retrieve High Scores

    Create an empty movie clip with instance name highScores containing 2 columns of 10 dynamic text fields with the names "rankz_n"+(i+1) and "rankz_v"+(i+1) where i goes from 0 to 9.



    var abrazor30Data:URLRequest = new URLRequest("http://rankz.armorbot.com/get/top10.php");
    abrazor30Data.method = URLRequestMethod.POST;
    var variables:URLVariables = new URLVariables();
    variables.flashkey = "YOUR FLASH KEY";
    variables.SU0249 = "YOUR SU0249";
    abrazor30Data.data = variables;
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.TEXT;
    loader.addEventListener(Event.COMPLETE, dataOnLoad);
    loader.load(abrazor30Data);
    function dataOnLoad(evt:Event) {
    _rankz_ar_ = loader.data.substring(6,loader.data.length).split( "<u/*/u>");
    for (i=0; i<_rankz_ar_.length; i++) {
    tempv = _rankz_ar_[i].split("</*/>");
    highScores["rankz_n"+(i+1)].text = tempv[0];
    highScores["rankz_v"+(i+1)].text = tempv[1];
    }
    highScores.visible = true;
    }


    Jerod Fritz
    http://www.popdw.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center