Solved

onMouseDown and onRollOver events at the same time

Posted on 2006-11-12
3
290 Views
Last Modified: 2012-06-21
Hi Folks

I have a drag and drop. My problem is when I am dragging "d1_mc" and my cursor is on "drop_01_mc" the Rollover does not work.

It works if I am not dragging "d1_mc"

How can i execute a onRollOver function when I am dragging "d1_mc" and it is on top of "drop_01_mc"

Any Ideas
Thanks

d1_mc.onMouseDown = function(){
      if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
                  this.startDrag();
                  this.swapDepths(depths++);            
      }      
};

d1_mc.onMouseUp = function (){
      if(this.hitTest(_root._xmouse,_root._ymouse,true)){
            this.stopDrag();
                  if(this.hitTest(drop_01_mc)){
                        this.gotoAndStop(3);
                  }else{
                        this._x = this.origX;
                        this._y = this.origY;
                        playClonk();
                  }
      }
}



drop_01_mc.onRollOver = function (){
      trace("drop01mc rollover");
}

drop_01_mc.onRollOut = function (){
      trace("drop01mc rollout");
}
0
Comment
Question by:rgarimella
3 Comments
 
LVL 5

Accepted Solution

by:
blockage1 earned 500 total points
ID: 17926495
One solution would be to create an invisible drop target movieclip on top of d1_mc and attach the rollover handlers to that instead. Make it the same shape as drop_01_mc but set its alpha to 0%.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question