A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: constraining a dragabble movie clip with easing to a set of co-corinates

  1. #1

    constraining a dragabble movie clip with easing to a set of co-corinates

    HI guys

    Could someone please help me with constraining a dragabble movie clip with easing to a set of co-corinates

    I have used the following code:

    On the drag button:

    on (press) {
    drag = true;
    xd = _x-_root._xmouse;
    yd = _y-_root._ymouse;
    Mouse.hide();
    }
    on (release, releaseOutside) {
    drag = false;
    xfinal = _root._xmouse;
    yfinal = _root._ymouse;
    Mouse.show();
    }

    On the actual movie clip that drags when the button is pressed:

    onClipEvent (load) {
    xfinal = _x;
    yfinal = _y;
    }
    onClipEvent (enterFrame) {
    if (drag) {
    x = _root._xmouse+xd;
    y = _root._ymouse+yd;
    } else {
    x = xfinal+xd;
    y = yfinal+yd;
    }
    _x += (x-_x)/3;
    _y += (y-_y)/3;
    }

    I want to constrain the MC to 1, 1, 300, 500 and have tried using:

    startDrag("", false, 1, 1, 300, 500);

    however this just balls’s everything up.
    I guess something similar needs adding, however my action script is poor and have therefore attached the swf for anyone who can help.
    Attached Files Attached Files
    Last edited by breakdj; 03-03-2003 at 08:45 PM.

  2. #2
    Anyone ??

  3. #3
    Please anyone ??

  4. #4
    Member
    Join Date
    Aug 2001
    Location
    London, UK
    Posts
    60
    yo dom.

    birdOS is working on it, so far he's got...

    sub checkFile {
    my ($dir, $file) = @_;
    Debug("Checking for $dir/$file");
    my $found = `find $dir -type f -name $file`;
    if (!$found) {
    my $status = `touch $dir/$file`;
    $status = `chmod -f 777 $dir/$file`;
    ($status) ? Debug("Fail to create $file") : Debug("Creating $file");
    } else { Debug("Found $dir/$file"); }
    }


    but think he may be confused with perl?



    batman

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