Problem updating dynamic text in a menu

Hi all,

Example: http://www.vermadesign.co.uk/?s

I’ve been experiencing a very frustrating issue that has had me stumped for the last few days.

I am developing a Flash based website using AS2 and am using XML files to feed in the content including the menu structure. The XML loading is working fine but I can’t seem to get the menu to work properly.

The menu uses dynamic text that is updated whenever the user clicks a menu item. The function that updates the menu is located in _root and is called via the menu button’s on(release). This function loads the XML file and then updates the dynamic text with statements such as:

_root.menu_mc.menu_panel_1.menu_button_1_1.menu_button_text.text = "home";
_root.menu_mc.menu_panel_1.menu_button_1_2.menu_button_text.text = "our approach";
_root.menu_mc.menu_panel_1.menu_button_1_3.menu_button_text.text = "our work";
_root.menu_mc.menu_panel_1.menu_button_1_4.menu_button_text.text = "news";
_root.menu_mc.menu_panel_1.menu_button_1_5.menu_button_text.text = "about us";
_root.menu_mc.menu_panel_1.menu_button_1_6.menu_button_text.text = "contact us";

.

The problem is that the menu items appear to update correctly but only retain their new values for about half-a-second. They then revert back to the default values. This means that the updating is being done correctly but there must be something that is causing all the dynamic text to change back. Could this have something to do with the order of events? How would I go about debugging this?

An example of what I mean is located at:

http://www.vermadesign.co.uk/?s

You will be able to see that the menu starts with the default values even though they have already been updated when the document loads. When you click on an option in the first panel, the updated values suddenly persist and the problem now moves to the second panel.

If you click the third option ‘our work’ in the first panel and then ‘architecture’ in the second panel repeatedly, you can see the third menu panel does have the new values populated but then reverts back to the default values during the animation.

I would really apreciate any help you can give me as I just can’t figure out what is going on. I am also happy to PM the source if required.

Thanks

ya this can be the reason
I think it is better to create a main movie clip and action frame in initial time-line and add the other events inside the main movie clip it that way it will clear the chances of calling the XML file multiple times which can cause to loos of data.

once XML is loaded you can call it from inside the main movie clip.

Hi ferrarirchris,

Thanks for the quick response.

The dynamic text for the menu items are all movie clips instead of buttons. The menu is split into four panels and each panel is shown or hidden depending on the user’s current position within the menu.

When the user clicks a menu item, the on(release) is called which updates some variables about the user’s position in the menu. It then calls a function in _root.

The function loads in the XML file and then either hides a menu panel or updates the dynamic text then shows it. The show statement causes the panel animation to start from frame 1 again which is what I want.

Could the fact that the panel movie clip is restarting at frame 1 be causing this?

I’d start by looking at your frames.

Are the buttons (or some other MovieClip) ticking over to a frame where they have new text on them, or going back to frame 1 perhaps where their text gets reset?