Skip to main content
chenjil43641795
Legend
January 20, 2021
Question

(hrml5,ANCC,JS)(Splicing name;Array;method)The error is known, but it will not be modified.

  • January 20, 2021
  • 1 reply
  • 439 views

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,
}
    This topic has been closed for replies.

    1 reply

    kglad
    Community Expert
    Community Expert
    January 20, 2021

    you didn't close your "on" method and you have an extraneous right bracket.  ie, you're missing a right paranthesis at the end of your shown code and you have mismatched brackets.

     

    other than that, i can't determine what that's supposed to do even if it were syntactically correct.

    chenjil43641795
    Legend
    January 21, 2021
    No text available
    kglad
    Community Expert
    Community Expert
    January 21, 2021

    i'm not sure what you mean by that, but

     

    map1 is properly defined without syntax error while dt has a syntax error (comma after last element).