A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: drag and drop script

  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    18

    drag and drop script

    I hope someone can explain this code to me. i am using MX pro
    I have a window box that i need to have drag and drop. this window box size will change depending on the text in it. i need the window to be restricted in it's movement inside the flash area.

    the mc containing the window box is at 0,0 on the maintimeline.
    the window box size is w=253.4, h=200
    it's upper left corner of the window box is at x=6 and y=255
    the document size is 800 x 600

    here is the code:

    on (press) {
    this.startDrag(false,6, 255, 790-this._width, 100-this._height);
    }
    on (release, releaseOutside) {
    stopDrag();
    }

    can someone please also tell me how to write code that will adjust the movement based on the size of the box?

    thanks for info.
    dawn
    Last edited by dawnkmi; 03-24-2006 at 01:26 PM.

  2. #2

    Example Solution

    Here's an FLA of a working example.
    Attached Files Attached Files
    The corners have eyes!!!

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    18
    i appreciate the info but this does not answer my question. when looked at your fla. the box did not stay within the restraints of the stage.

    thanks,
    dawn

  4. #4
    did you even TEST the movie? wtf man test the god - damned movie. The box IS restrained to the boundaries of the movie. In the code --- Stage.width --- that is the boundary of the swf's width. same with Stage.height.
    The corners have eyes!!!

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