Hey,
Im working on a school project in flash, and I solved many problems by reading the forums. But there is one problem that I just don’t know how to solve.
I have an object (objectB) which should be highlighted when the mouse drags anohter object (objectA) over objectB. ObjectB contains a rollout and rollover which tells the objectB timeline to go to a specified frame where the color of the object in movieclip objectB is different from the first frame.
Anyhow, this is my maincode in the maintimeline of the flashfile so far;
objectB.addEventListener(MouseEvent.MOUSE_DOWN, dragObject);
objectB.addEventListener(MouseEvent.MOUSE_UP, dropObject);
function dragObject(event:MouseEvent):void
{
event.target.mouseEnabled = false;
event.target.startDrag(true);
}
function dropObject(event:MouseEvent):void
{
event.target.mouseEnabled = true;
event.target.stopDrag();
}
Now the reason why I use event.target is because I’m going to put in just too many objects that will do the same thing later on.
So the problem is that the objectB won’t be dropped, or stopped dragging. The rollover function on objectA works when I roll over it when I drag objectB. But why isn’t the function dropObject ever executed?
Do someone have a clever and easy solution to this? I guess there is something obvious that I’ve missed.