actionscript 3 - AS3 - Error #1010: A term is undefined and has no properties -
actionscript 3 - AS3 - Error #1010: A term is undefined and has no properties -
i maintain getting next error:
typeerror: error #1010: term undefined , has no properties. @ finalgame_fla::maintimeline/pulse() [finalgame_fla.maintimeline::frame1:183]
i have checked code multiple times , can't seem figure out wrong because high score table still displays right entries.
below code showing variables defined , code causing problem.
defining variables & arrays
var playername:string="anonymous"; var allscores:array = new array(); var nameboxes:array = new array(mcscoreboard.player1, mcscoreboard.player2, mcscoreboard.player3, mcscoreboard.player4, mcscoreboard.player5); var scoreboxes:array = new array(mcscoreboard.score1, mcscoreboard.score2, mcscoreboard.score3, mcscoreboard.score4, mcscoreboard.score5); var sr:sharedobject=sharedobject.getlocal("previousresults"); if (sr.data.allscores!=undefined) { allscores = sr.data.allscores; }
function displaying high scores
if (livesleft==0) { stopgame(); mcscoreboard.visible=true; var playerscore:object = new object(); playerscore["name"] = playername; playerscore["score"] = totalscore; allscores.push(playerscore); sr.data.allscores = allscores; sr.flush(); allscores.sorton("score", array.descending|array.numeric); (var i=0;i<allscores.length;i++) { var obj:object = allscores[i]; *nameboxes[i].text = obj["name"];* scoreboxes[i].text = obj["score"]; } }
flash says line displayed second-to-last causing problem. variables , arrays have been declared appropriately not understand going wrong.
actionscript-3 flash actionscript
Comments
Post a Comment