Cathracic consequences for IF errors

xiaoxiao2021-03-06  61

Please see the following four button event test_btn.onrelease = function () {var i = 5; var j = 0; for (j = 1; j <= i; j ) {if (j == 4) {trace (" J = four ");} else {trace (" j = " j);}}}; test2_btn.onrelease = function () {var j = 4; if (j = 4) {trace (" j = four " } Else {trace ("j =" j);}}; test3_btn.onRelease = function () {var i = 5; var j = 0; for (j = 1; j <= i; j ) { IF (j = 4) {trace ("j = four");} else {trace ("j =" j);}}}; test4_btn.onrelease = function () {var i = 5; var j = 0 WHILE (J <= I) {if (j = 4) {trace ("j = four");} else {trace ("j =" j);} j ;}}; you will find as long as execution The event will cause the flash program to be executed correctly, and the CPU usage of this unit is 100%, which is the error writing method in the IF ("if (j = 4) {" should write "IF (j == 4) {") And the result of cyclic work.

转载请注明原文地址:https://www.9cbs.com/read-105990.html

New Post(0)