Solved

onMouseDown and onRollOver events at the same time

Posted on 2006-11-12
3
270 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now