Hey all, so I define a menuStyle and then use code like this:
with(milonic=new menuname("My Portfolios")){
style=menuStyle;
margin=style.margin;
style.subimage="/res/menu.arrow.right.gif";
style.subimagepadding="3";
The last two lines actually end up modifying the menuStyle object, which would indicate that the style=menuStyle line copies by reference the original object, how can I make it so this doesn't happen?
Specifically I want to modify only the style for this object, but start with the settings from 'menuStyle'.
Thanks!
coding question...
Hi,
Doing style=menuStyle will just make a new reference to the menuStyle object, it won't actually copy it.
If you need to copy an object you can use the copyOf() function that is included with the Milonic DHTML Menu, like this:
So your code will be something like this:
Hope this helps
Andy
Doing style=menuStyle will just make a new reference to the menuStyle object, it won't actually copy it.
If you need to copy an object you can use the copyOf() function that is included with the Milonic DHTML Menu, like this:
Code: Select all
style = new copyOf(menuStyle);
Code: Select all
with(milonic=new menuname("My Portfolios")){
style=new copyOf(menuStyle);
margin=style.margin;
style.subimage="/res/menu.arrow.right.gif";
style.subimagepadding="3";
Andy