Question
(hrml5,ANCC,JS)(Splicing name;Array;method)The error is known, but it will not be modified.
Use alone “alert”,It can be run.
If use "on click", an error occurs.
Browser console.log "Uncaught SyntaxError: missing ) after argument list"
It should be an error caused by the name in "for"
But i don't know how to solve
var map1 = [{id:11}, {id:12}, {id:13},{id:14}, {id:15}, {id:16},{id:17}, {id:18}, {id:19}],jswz = 0
Object.prototype.myUcase = function() {
alert("map1" + this.id) //It can be run
this.on("click", function() {alert("map" + this.id)} ;//error, Unable to run
}
for(i = 0; i < map1.length; i++) {
//asa0 to asa8,This is a movie-clip on stage
exportRoot["asa" + i].id=map1[i].id
exportRoot["asa" + i]=map1[i]
exportRoot["asa" + i].myUcase()//Error,
}