View Full Version : dinamically naming objects

10-27-2003, 09:21 AM

I'm trying to create this online restaurant menu. At the minute I have a set of buttons with the section names and those buttons call the right information to be placed in the right places. It all works fine apart from the fact that the client doesnt want to be limited in the number of sections, so Im trying to build a generic function which will be called from all the buttons passing just the button number and the function does the rest instead of hard coding all the procedure in the button.

But i just cant figure out how to write the sintax to call a dinamically named variable. For example say I press button 01, it will call the function setMenuObjs("01") and the function looks like this:

function setMenuObjs ( sec ){
_root.dishName01 = _level0.s + sec + _item01_name;
_root.dishDesc01 = _level0.s + sec + _item01_desc;

I know this is wrong... any ideas?

Thanks in advance

10-27-2003, 10:04 AM
if i attach a movie like this

// then i can refer to it as