A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: StartDrag Help

  1. #1
    Junior Member
    Join Date
    Jun 2003
    Posts
    14

    StartDrag Help

    I was wondering if anyone could help me, i have something that drags, but i want to block it so you can't drag it past a certain area.
    I checked the actionscript Dictionary and it said that i can plug it into the start drag actionscript with left, right, top, and bottom; can any of you help figure out how in the hell i can do that?

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hi,

    instanceNameOfClip.startDrag(true, 50, 50, 450, 350);

    the true, parts tells flash to drag the clip with the registration point centred under the mouse pointer, then the numbers are the values (in pixels) the registration point can't be dragged past in the order left, top, right, bottom. so this would constrain the clip to an area 400 pixels wide by 300 high 50 pixels from the top and left of the stage.

  3. #3
    Junior Member
    Join Date
    Jun 2003
    Posts
    14
    why thank you so very very much, i shall check this code when i get home from work

  4. #4
    Junior Member
    Join Date
    Jun 2003
    Posts
    14
    ok
    i did the start drag parameters, my code is:

    on (press) {
    startDrag( "true", "2", "370", "2", "30");
    }
    on (release) {
    stopDrag();
    }



    It says i have a syntax error, and this is what that says:

    Symbol=Float, Layer=Layer 1, Frame=1: Line 2: Lock center parameter must be true or false
    startDrag( "true", "2", "370", "2", "30");

    What can i do?
    please help

  5. #5
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Syntax is a funny word for all those " " " " thingies you got in there. Get rid of them and it'll work.

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