-
I have a dynamic menu system that I just developed for a client. The movie clip buttons dynamically duplicate by the number of records pulled from the database and the button labels dynamically populate based on the values in the field.
I ran into a problem when trying to get the buttons to actually do something when pressed. I figured I could just code the button actions to pull the data the same way as I populated the button labels. The button lables populate from a field called "Cat" and the action should be pulled from a field called "CatLink". The "CatLink" field holds the value of the .swf file to load into the movie.
The following code is what I used to populate the lables:
thisClip.Button_txt.text = result.items[i].Cat;
Here is what I've used to TRY and set the actions:
_root["button"+i].onRelease = function() {
loadMovieNum(result.items[i].CatLink,1);
}
If anyone has ran into this situation, or know some way to make this work, your help will be much appreciated.
Thanks in advance,
Scott
-
um...correct me if i'm wrong, but shouldn't that be eval("_root.button" + i + ".onrelease = function() {...}");
the eval may end up working for you. also, didn't you name your buttons button_[i], not button[i]?
i'm tired, so i could be off, but these might be worth looking into
hth,
Deep (just a guy)
<font face="arial" size="2">
Pradeep Kumar Nair, B.Math
Manager, Front-End Technologies
http://www.bluespark.com
ICQ: 39102360
</font>