A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: drag outside mask

  1. #1
    Senior Member
    Join Date
    Aug 2005
    Location
    The Netherlands
    Posts
    326

    drag outside mask

    When I use this code to drag an object behind a mask object it works fine. But the onrelease isn't triggered when I release the object outside the mask object. Why is that and how do I solve this?
    Code:
    circle.setMask(square);
    this.onEnterFrame = function() {
    	circle.onPress = function() {
    		circle.startDrag();
    	};
    	circle.onRelease = onReleaseOutside=function () {
    		circle.stopDrag();
    	};
    };

    Illustration | Animation | Web Banners | Graphic Design
    Ducklord Studio

  2. #2
    Banned deepakflash's Avatar
    Join Date
    Aug 2007
    Location
    [Object not found]
    Posts
    1,160
    try this:
    Code:
    circle.setMask(square);
    circle.onMouseDown = function() {
    	if (this.hitTest(_root._xmouse, _root._ymouse)) {
    		this.startDrag();
    	}
    };
    circle.onMouseUp = function() {
    	this.stopDrag();
    };

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center