User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18

Thread: Multi Drag and Drop at once?

  1. #11
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Nice example! Can't use the "Drag object" in flash though

  2. #12
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It's funny that this thread is up right now, because I'm building a level editor and needed a way to group objects so I can drag a box around them to select them and then move them.

    But yeah the examples aren't that much help for this because it isn't dynamic. I came up with a solution by just using an array to keep track of the x/y positions of each object I want to move. Basically when you click the mouse down, you should run a fastloop for the number of selected objects and save this to an array:

    XMouse - X position of each object being iterated (save fast loop index to X array value)
    YMouse - Y position of each object being iterated (just set Y array value to 1)

    Also on the click down event, set a flag somewhere to 1 to indicate that dragging is active.

    Then have a condition below that checks for the dragging flag to be 1, and while it is true run an opposite fastloop through those objects again but instead of saving to array, you read from it:

    - Set x position of iterated object to XMouse - X Array value at current iteration
    - Set y position of iterated object to YMouse - X Array value at current iteration and Y at 1

    Then on mouse not being held down, set the drag flag to 0 to stop the dragging.

    All you are doing is storing all the object x/y positions in relation to the mouse, so it knows where to place them once the mouse starts moving.

  3. #13
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    XStar's Avatar
    Join Date
    Feb 2012
    Location
    Winchester, VA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interesting! Really cool ideas! I will put these to the best of use! Thanks so much!

  4. #14
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Konidias, be interested in seeing an example of this if you have the time.

  5. #15
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Sep 2006
    Posts
    311
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @KLiK-iT
    Here is the updated example without any extension, should work in Flash now: Drag & Drop Groups 2.mfa


    Additional the dragging of a single item is now restricted to the range of the Container box by

    1) Find the max. value of X(Item) and Left Edge(Box)
    2) Find the min. value of 1) and Right Edge(Box), this is the new X-Position of the object.
    The same goes for the Y-Position.

    In one line for X and Y:
    Set X to Min(Max (X(Item), Left Edge(Box)), Right Edge Box)
    Set Y to Min(Max (Y(Item), Top Edge(Box)), Bottom Edge Box)


    @Konidias
    This example uses a similar solution you suggested, but stores the position values directly in the Alterable Value of the objects.
    With the Pick object with fixed value-Condition you can set/read the values and set the position of the objects each one in a single line, a Fastloop is not necessary.

  6. #16
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It goes to show how many different ways there are to accomplish the same type outcome in MMF. Nice!

  7. #17
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I think I avoided the pick object method because I was using a selection rectangle method and not just putting an active object as a box behind the other objects. Meaning you could drag a selection box over multiple objects and they would then be "selected" you then click drag any one of them to move the entire group. But maybe I was doing something wrong... I might try this other method then, but really in this case a fast loop is not going to harm anything. Maybe if I was having to select and move 1000 objects.

  8. #18
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    XStar's Avatar
    Join Date
    Feb 2012
    Location
    Winchester, VA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Amazing Quinto! Thanks so much!

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Drag and drop movement- force drop action
    By qenio in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th April 2013, 09:53 PM
  2. Drag & drop without drag & drop object.
    By soloman in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 20th August 2011, 02:45 AM
  3. Drag and Drop
    By legocacher in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 18th December 2010, 11:30 PM
  4. Drag & Drop Example
    By Stephen in forum File Archive
    Replies: 5
    Last Post: 13th August 2009, 03:08 AM
  5. Drag and drop
    By pl in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 5th August 2006, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •