kennethpardue
02-10-2003, 04:26 PM
I'm having trouble getting a dynamic variable to print right. What's wrong with this method (the "i" below will be a number passed through a function)?
nav_btn_1.nav_btn_name="MyButtonName"
i=1;
trace (this["nav_btn_"+i+".nav_btn_name"]);
-- I get 'undefined' returned
or
trace (["nav_btn_"+i+".nav_btn_name"]);
-- I get the literal 'nav_btn_1.nav_btn_name' returned instead of MyButtonName
nav_btn_1.nav_btn_name="MyButtonName"
i=1;
trace (this["nav_btn_"+i+".nav_btn_name"]);
-- I get 'undefined' returned
or
trace (["nav_btn_"+i+".nav_btn_name"]);
-- I get the literal 'nav_btn_1.nav_btn_name' returned instead of MyButtonName