// Quick AS Q
- Started
- Last post
- 3 Responses
- jgjh151
I'm calling a fuction that I pass a variable into. I can trace the variable value, so I know its getting into the function.
I use the variable in a path to a movie clip to change the alpha. It doesn't work. It does work if I hardcode in the movie clip name.
Here is the code:
// when mouse is over a project mc ////////
function over_project(project_title, my_mc) {
trace("OVER " + my_mc);
_root.sliders_mc.my_mc._alpha = 50;
_root.project_text_mc.project_te... = project_title;
}
////////////////////////This is the line that only works if I replace the variable with the actual hardcoded movie clip name:
_root.sliders_mc.my_mc._alpha = 50;
(ca't get my_mc to work in the path)
AAAAAAAAAHHHHHH!
Why?
- unfittoprint0
you have eval that bitch (because my_mc is a string):
root.sliders_mc[my_mc]._alpha = 50;
Note: [] brackets do the same thing as eval()...
- knoxel0
good vs. eval
- jgjh1510
perfect, ya, knew it had to work some how, must have missed that one.
THANKS!!!