Problem in a function actionscript -


How do I add a variable that changes in a loop with a dummy variable:

  Function reset now (menudown) {trace (menonom); (I = 0; i & lt; = 7; i ++) {If (Menonum! = 1) {menu_all_mc.this ["btn _" + i] .gotoAndStop ("closed"); }}  

This ["BTN _" + I] does not work

I have to pass BTN name like: BTN_1 and next loop BTN_2 ...

I'm convincingly (I do not do action script but JS), but if your If I have the same variable, then you will need to use the closer to capture that code and to bind it:

  function resetLL {menonu} {trace (menuNum) ; (I = 0; i & lt; = 7; i ++) {(function (i) {if (menuNum! = 1) {menu_all_mc.this ["btn _" + i] .gotoAndStop ("off"); }}) () I); }}  

Let me know that it does not work, also make sure that this keyword refers to the correct execution reference.

Edit: This can not be referenced in that way, are you sure that it is not just menu_all_mc ["btn_" + i] ? This is not the property of the object, unless you explicitly define it.

  o = {}; Trace (o.is == undefined)  

will evaluate on the right because it was never defined. This function will reference the current execution reference in scope but do not prefix it with any other object.

Can you clarify that the owner of the object .btn1, etc.?


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -