Hello,
The score text is stored in this.position for each button:
At the bottom of the function called createRectangle() in the onFrame(2) scripting section:PHP Code:var load_vars_1 = new LoadVars();
var text_array_1 = new Array();
load_vars_1.load("settings.txt");
load_vars_1.onData = function(e) {
for(var i=0;i<e.split("\n").length;i++){
text_array_1.push(e.split("\n")[i].split("\r")[0])
_root["mc"+i]["num"+0].text=text_array_1[0].split(",")[i+1] + " score text=" + _root["mc"+i].position
//The start up load is at array position 0: text_array_1[ 0 ].split(",")[i+1] passed the first comma.
_root["mc"+i]["num"+0].setTextFormat(myformat);
}
}
download v4 (swish)PHP Code:_root["mc"+rect].onRelease=function(){//On release function for the round square.
if(this.position<_root.text_array_1.length-1){//If this buttons position is smaller than the text_array that stores the settings.txt data.
this.position++//We can still increase the number for the current button.
this["num"+0].text=_root.text_array_1[this.position].split(",")[int(this._name.split("c")[1])+1] + " score text=" + this.position
//Set the textfield for the current round square to be: _root.text_array_1[ this.position ].split(",")[int(this._name.split("c")[1])+1] //this.position to go to the second array spot & split mc2 to be [2]+1 for the current array.
this["num"+0].setTextFormat(myformat);//Update the textformat style.
}
}
download v4 (as2)




Reply With Quote