A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Drag and Drop

  1. #1
    Member
    Join Date
    Dec 2000
    Posts
    99

    resolved

    I have 3 buttons. I want to drag and drop only one in random order.
    My problem is that when i try drag one all the other buttons drag to.
    All buttons are in seperate layer(3 layers).

    I think i have to put something in target(????).
    I try the name i gave to the button but didnt work.
    All buttons still drag and drop in the same time.
    I only want one in each time.

    The cose i use is:
    on (press) {
    startDrag ("");
    }
    on (release) {
    stopDrag ();
    }

    What do i put on the "" ?
    I try the name of the button but didnt work.
    I dont know how to name a instance on a button, because there is no option available.
    Movie Clip - Behavior and "Name"(here i can name a instance)
    Button - Behavior and "Option"(here i cant)

    I try evan with a Movie clip but that way i have more problems, i only can drag the last layer and when i clik on any part of the scene he drags to.
    Because the option Mouse Down and Mouse UP is for the entire scene.
    With movie clip i can name a instance but didnt work to.

    Hel me please, i'm complited LOST...

    Best Regards

    Rui

    Ps: Sorry to put so many posts but i realy need this fix

  2. #2
    Senior Member Branny's Avatar
    Join Date
    Feb 2001
    Location
    Manchester/UK
    Posts
    512
    you have to put the button inside a movie clip then give that movie clip an instance name then pu that instance name in the " " it should then only drag the one with that instance name.

  3. #3
    Junior Member
    Join Date
    Sep 2001
    Posts
    3
    Ok, this is really simple. Create an empty movieclip instance(ctrl+F8) give it a name. Then from your library(ctrl+L) drag it to the stage. Double click the small movieclip so you are on its timeline. Cut one of your buttons and paste it inside the movieclip, or create a new graphic and change it into a button instance. The button's actions should be:

    on (press) {
    startDrag (this);
    }
    on (release) {
    stopDrag ();
    }

    Repeat this process for each of the desired buttons.

    If you have any questions email me.

  4. #4
    Member
    Join Date
    Dec 2000
    Posts
    99
    Originally posted by Branny
    you have to put the button inside a movie clip then give that movie clip an instance name then pu that instance name in the " " it should then only drag the one with that instance name.
    Thanks :-))))))))))))
    That is so simple that i ....
    TY again.

    Best Regards

    Rui

    Ps: I try and it works. YESSSSSSSSSSSSSSSS :-))))))))

  5. #5
    Member
    Join Date
    Dec 2000
    Posts
    99
    Originally posted by damnice
    Ok, this is really simple. Create an empty movieclip instance(ctrl+F8) give it a name. Then from your library(ctrl+L) drag it to the stage. Double click the small movieclip so you are on its timeline. Cut one of your buttons and paste it inside the movieclip, or create a new graphic and change it into a button instance. The button's actions should be:

    on (press) {
    startDrag (this);
    }
    on (release) {
    stopDrag ();
    }

    Repeat this process for each of the desired buttons.

    If you have any questions email me.
    Very simple to.
    Thanks.

    Regards

    Rui

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