I’ve been trying to make a map of an area with drawing pins stuck in it to represent specific places. So that people can add their own pins to the map, I’ve stuck the coordinates for each pin into a database and then grab the data when the map is viewed and use attachMovie to make the pins appear. The result is something like the attached image.
Now the map is much bigger than the stage area so I want to make it so my map can be dragged around so you can see all of it. I turned it into a movieclip (walesmap) and attached the following AS:
onClipEvent(enterFrame){
this.onPress = function() {
this.startDrag();
};
this.onRelease = function() {
this.stopDrag();
};
}
So now the map can be dragged around. But since the pins are separate they obviously remain stationary. I’m looking for a way to make it so that all the pins move with the map.
If it helps, here is the attachMovie AS for the pins:
for (j=0; j<coords.length; j++) {
attachMovie("pin","pin"+j,j);
mappin = _root["pin"+j];
mappin._x = videoxarray[j];
mappin._y = videoyarray[j];
mappin.bubbledata.vidtitle.text = titlearray[j];
mappin.bubbledata.vidcaption.text = captionarray[j];
mappin.bubbledata.thumb.loadMovie("http://www.mysite.co.uk/stuff/phpflash/"+thumbarray[j]);
}
Things I’ve tried:
Adding additional startDrag(“pin1”) commands to the on(press) for the map. Only drags the last one in the list.
Changing ‘mappin = _root[“pin”+j]’ to ‘mappin = _root.walesmap[“pin”+j]’ in an attempt to get them inside the map. All pins appear at 0,0 and don’t seem to have their
variables loaded. Still don’t drag.
Would greatly appreciate any advice.