I’ve set up an array to store info. about land use in a farming game. There are 8 fields and I need to be able to store the changing land use for each one. So, my array is called “land_use” and I’ve set land_use to land_use as zero to start with. No problems so far. However, when I try to change the land use in a field by using “land_use = 1;” and testing it using trace I get ‘undefined’. This is a mystery because it displayed perfectly before I changed it. It I add the code to a button it seems to work fine, but when used on a drag ’ n drop movie clip it doesn’t. All other code on the movie clip works perfectly.
What am I doing wrong?:tired:
Probably a scoping issue. Because the code is attached to a movieclip, Flash expects to find an array called land_use attached to the movieclip as well. When it doesn’t find it, it returns the undefined value. Try substituting _root.land_use = 1; instead