We help IT Professionals succeed at work.

How can I make several dynamically generated movieclips on my map drag along with my map movieclip in Flash?

usqt82
usqt82 asked
on
I am using Flash CS3 but I need to publish this for use with Flash 7 player. I am creating a map that shows several city points (which are movieclips). These movieclips are dynamically placed on the map using "attachMovie" with the points being extracted from an xml file. Is it possible to make dynamically generated mc's draggable? I need them to move along with the map when the map is dragged over the screen. The map is directly on the timeline and is not attached by code, but I could do that if it would help. The city points must remain dynamic.

I am sure I'm not the first person to do this, but I cannot find any information on it. Can someone please point me in the right direction?
Comment
Watch Question

Engineering Manager / Architect
BRONZE EXPERT
Commented:
Yes, it's possible. But with regards to your scenario, I infer that you can drag the map around. If so, you need to select your map and give it an instance name (on the properties panel), name it "myMap" for now.

Your attachMovie code would change a bit to something like this:

myMap.attachMovie("Point",instancename,myMap.getNextHighestDepth());

With this, the points will become children of the map and if you drag the map around, the points will move accordingly.

Good Luck
-V

Explore More ContentExplore courses, solutions, and other research materials related to this topic.