want to remove warnings:

百般思念 提交于 2019-12-11 14:56:21

问题


I am facing a problem as Duplicate variable definition while compiling but it is not at all effecting my program.

Is there any way to remove compiler errors beacause it is coming every time when i run movie.


回答1:


Remove the duplicate variable definition. I suspect that you are doing something like the following:

function foo() : void {
    for(var i:uint=0; i<10; i++) {
        // do stuff in here
    } 
    for(var i:uint=0; i<10; i++) {
        // do stuff in here
    }
}  

This will complain about duplicate variable definitions at compilation because you've got two definitions of i. During compilation, actionscript does what's called "variable hoisting". It means that all variables declarations are moved to the top of the function. (I don't know exactly why it does this) If you make the second loop look like the following, the warning will go away:

for(i=0; i<10; i++) {
    // do stuff here
}



回答2:


Try from the Edit menu Preferences/Warnings and check off those warnings that you don't want to see.



来源:https://stackoverflow.com/questions/2316605/want-to-remove-warnings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!