I have a grid of movieclips that are divided into four arrays. The graphic is actually a map and various neighborhoods make up the four geographical districts that are represented by the arrays. What I want to do is allow the user to pull a neighborhood into another district by simply dragging it over. The neighborhood movieclip then changes color, snaps back to its original position and thus becomes visually part of the next district. When I do this, I have the movieclip spliced from its original array and pushed into the new one. All of this works perfectly, but I’ve one into one little snag.
The new array configurations work fine as long as you’re in the specific Drag function, but when you go outside that function to move another neighborhood movieclip, the arrays at the top that start when the interactive opens are no longer changed. They revert back to their original listings.
I can’t add the movieclips to the stage dynamically because they are actually parts of the map. I don’t think I can populate the arrays dynamically to begin with because the movieclips do have to be on stage with their instance names in the property window.
I need to find a way to actually alter the arrays that exist when the file opens. As it is they are simple arrays with the movieclips listed. Is there a way I can dynamically populate them and then repopulate them as the neighborhood movieclips are pushed and spliced in and out of the various arrays? As I’ve said the dragging and dropping and pushing and splicing is working fine, but I’m not able to figure out how to dynamically alter the original arrays so that when I’m done with the first function and move on to another the arrays reflect the changes made to the arrays in that first function.