Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Actionscript question

Status
Not open for further replies.

GeeBee2

Technical User
Aug 29, 2005
12
US
I am actionscript neophyte so to speak, I am loading scores from a text file with the following format

filelist=100,95,78,90,80

when attaching this to a button I am not envoking the trace function, nothing happens. This works fine without attaching it to a button--- it doesn't work when adding the onrelase and the closing curly bracket. Any help with syntax would be great.

Thanks




[as]
on (release, keyPress "<Enter>") {
files = new Array();
lv = new LoadVars();
lv.onLoad = function() {
fl = this.filelist;
data = fl.split(",");

for (var i in data) {data = Number(data);}
n = data.length;
myColor= colorHex.slice(0,n);
//gotoAndPlay (2);{

trace(data);

};
lv.load("scores.txt");
}
[/as]
 
cant see all you are trying to do...but

on (release, keyPress "<Enter>") {
lv = new LoadVars();
lv.onLoad = function() {
scores = this.filelist.split(",");
for(i=0;i<scores.length;i++)
trace(scores);
};
lv.load("scores.txt");
}

will certainly trace the numbers loaded
 
cant see all you are trying to do...but

Code:
on (release, keyPress "<Enter>") {
lv = new LoadVars();
lv.onLoad = function() {
scores = this.filelist.split(",");
for(i=0;i<scores.length;i++)
trace(scores[i]);
};
lv.load("scores.txt");
}


will trace the scores loaded
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top