A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] here is the source

  1. #1
    ahajjaj
    Guest

    resolved [RESOLVED] here is the source

    sorry guys, im sending this again
    Its a drag and drop problem, you can see the problem, and the description of the problem and the flash source at this address, please help

    http://pcg-world.com/problem.html

  2. #2
    curmudgeon swampy's Avatar
    Join Date
    Jan 2001
    Location
    [wakey]
    Posts
    2,775
    I took a look.

    i don't know why you are using onclip event handlers, why not just use the on release to test if the drag clip hits the target ?

    here a streamlined version of your code where I've used a function and parameters to test both clips hitting their respective targets:

    Code:
    //function in main timeline
    function dropMe (clip, target) {
    	stopDrag ();
    // tests whether drag clip hit it's target
    	if (clip._dropTarget == target) {
    //set x and y co-ordinates of drag clip to it's target if it hit it
    		clip._x = eval(target)._x;
    		clip._y = eval(target)._y;
    // stop the drag clip from being dragged away from it's target 
    		clip.onTarget = true;
    		
    	}
    
    }

    NO code on b1 MC but code has been changed on it's button :
    Code:
    on (press) {
    // if this clip is not on it's target enable drag 
    	if (!OnTarget) {
    		startDrag ("");
    	}
    }
    on (release) {
    //call function in parent timeline - target clip is second paramter in brackets "/b"
    	_parent.dropMe(this, "/b");
    }
    and on the button within A1
    Code:
    on (press) {
    // if this clip is not on it's target enable drag 
    	if (!OnTarget) {
    		startDrag ("");
    	}
    }
    on (release) {
    //call function in parent timeline - target clip is second paramter in brackets "/a"
    	_parent.dropMe(this, "/a");
    }
    [Edited by swampy on 03-08-2002 at 10:12 AM]

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