views:

141

answers:

1

Flash CS4, AS2

I'm making a tour with a map. I'm using this startDrag code to move the map around:

menu.onPress = function() {
    this.startDrag();
};

menu.onRelease = function() {
    stopDrag();
};

This works perfectly. However, inside the "menu" movieclip I am using a hover tag startDrag code:

EllisIsland._visible=false;{}

EllisIland_mc.onRollOver = function() {
    EllisIsland.startDrag();
    EllisIsland._visible=true;
};

EllisIland_mc.onRollOut = function() {
    EllisIsland.stopDrag();
   EllisIsland._visible=false;
   };

This was working perfectly before I added the drag to the map, but now it won't work. I also have buttons in this movie clip that were working, but now are not.

Is there any way to make these elements work together?

A: 

It's one of those things that they fixed in AS3, but in AS2, you can't detect mouse events on elements that are inside elements that have a listener for the same event. The work around this is to detect, inside the menu on press function, if the mouse is over the ellisIsland_mc - if so, execute the ellisIsland start drag, if not, execute the general menu drag. I'd try using hitTest (http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary534.html) to detect which element the mouse is over.

quoo