Click to See Complete Forum and Search --> : enable buttons with dynamic variables and a string


kredd
10-24-2006, 11:57 PM
hello all,
i've got a campus map with buttons over the campus buildings. on rollover/rollout a "info balloon" appears/disappears. on click the balloon stays visible and the button is disabled so the rollover/rollout quit working.

i have 40-50 buildings with buttons(map MC). i have one info balloon(a MC nested in the map MC) . when each building button is clicked i need to send the name of that button to the 'close' button, in the info balloon MC, so that on release the 'close' button can re-enable the button.


the code for the first button would be:


btn1.enabled = false;
_global.actv_btn = "btn1"



the code in the "close" btn in the balloon MC that should re-enable the buttons:


_root.main_scroller.spContentHolder.*_global.actv_btn*.enabled = true;


the *variable* is what needs to change dynamically. don't really know if i need to use a _global variable or not. if i hard code the button name into the re-enable code it works fine. also trace(_global.actv_btn) shows the correct value is being passed, but still nothing happens.

i tried this 'close' button code as well...


sp = _global.actv_btn
_root.main_scroller.spContentHoldersp.sp.enabled = true;
trace(_global.actv_btn)


the trace shows its building the code with the *btn1* name but the code doesn't work. i hope i've made sense.

any ideas?? thanks!

kredd
10-25-2006, 11:46 AM
i think i confused my own self posting this question last night...does just not make sense or is there just no one who knows how? sorry, i'm the world's worst explainer!!!

kredd
10-25-2006, 05:10 PM
***FIXXXED***

this did it

this._parent._parent[actv_btn].enabled = true;