How to drag and drop multiple objects in a mask?

nightvision.jpg

I worked on a flash Simulator to show what our night vision product would look like in the dark.  I managed in the implementation with the following code below.  However, I can't add a picture "crosshairs" (or symbol) to the movable mask to make it work.  Can someone help me with the code?  I looked for hours on the internet and I can't make it work.  I'm new to Flash, but begins to learn as much as I can.

ActionScript 3:

img_nv. Mask = mask_mc;

mask_mc.buttonMode = true;

mask_mc.addEventListener (MouseEvent.MOUSE_DOWN, dF);

stage.addEventListener (MouseEvent.MOUSE_UP, dropF);

function dF(event:MouseEvent):void {}

mask_mc.StartDrag ();

}

function dropF(event:MouseEvent):void {}

mask_mc.stopDrag ();

}

Use a loop (such as enterframe) and update the position of the reticle to match the position of mask_mc.

mg_nv. Mask = mask_mc;

mask_mc.buttonMode = true;

for example, if you add reticle_mc to the stage in the authoring environment

removeChild (reticle_mc);

mask_mc.addEventListener (MouseEvent.MOUSE_DOWN, dF);

stage.addEventListener (MouseEvent.MOUSE_UP, dropF);

function dF(event:MouseEvent):void {}

addChild (reticle_mc);

this.addEventListener (Event.ENTER_FRAME, reticleF);

mask_mc.StartDrag ();

}

function dropF(event:MouseEvent):void {}

removeChild (reticle_mc);

this.removeEventListener (Event.ENTER_FRAME, reticleF);

mask_mc.stopDrag ();

}

function reticleF(e:Event):void {}

reticle_mc.x = mask_mc.x;  assuming that they both have the same reg points (as the Center)

reticle_mc.y = mask_mc.y;

}

Tags: Adobe Animate

Similar Questions

  • How to drag and drop multiple movieclips at the same time

    Hello world

    I'm a new actonscript 3 and adobe flash CC user and I am building an application but I have been stuck for several days. I have looked everywhere and tried everything I could think of, but I can't yet find a solution to my problem that I thought were pretty basic.

    Basically, let's say I have a rectangle and a circle on the stage. Once I did of the movieclips and assigned an instance name to each of them, I want to be able to perform a drag and drop the Rectangle so that both the rectangle and the circle become movable at the same time.

    For now, I have a mouse down events listener associated with the instance of rectangle, a method startDrag assigned to the rectangle instance and another assigned to the circle. But in this configuration, when I click on and drag the rectangle, only the circle is mobile (only the last line in the code is taken into account).

    I don't know if what I'm trying to achieve is feasible, but any help will be greatly appreciated, thank you!

    The startDrag() method can only work for one object at a time, so in your case the Treaty the last of them, designated the task.  This approach is to temporarily to plant the two objects in a container and then drag the container.

    rectangle.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);  When I click on the rectangle

    var dragMC:MovieClip = new MovieClip();
    addChild (dragMC);

    function fl_ClickToDrag(event:MouseEvent):void

    {
    dragMC.addChild (rectangle);        move objects in the container
    dragMC.addChild (circle);
    dragMC.startDrag ();
    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop); When I release the mouse button

    function fl_ReleaseToDrop(event:MouseEvent):void

    {
    dragMC.stopDrag ();
    Rectangle.x += dragMC.x;         Adjust the positions of the objects to their new location
    Rectangle.y += dragMC.y;
    Circle.x += dragMC.x;
    Circle.y += dragMC.y
    addChild (rectangle);                 move back to the scene objects
    addChild (circle);
    dragMC.x = dragMC.y = 0;       reset the benchmark for the dragMC
    }

    All this stuff of repositioning in the Drop function is necessary because when you drag the container, the positions of the content are still on their original coordinates inside the container.  So when you drop them they will resume their x / y positions in their new parent, meaning they go back where they were.  Reposition them where they have been trained to take into account the change in the position of the dragMC.

  • Problem with drag and drop multiple lines of ListView

    I work on an example application with 2 views of list that is the players and the team and implement drop and drop as players can be deposited to one list to the other. Everything works as expected when there is selection unique model is enabled in the source list view. However, if I have activated several model selection and drag 2 or more lines of source target list view list view, see the following exception after that the decline is over.

    Exception:

    java.lang.IllegalArgumentException: only objects serializable or ByteBuffer can be used as data with the format of data [subListPlayers]

    at com.sun.javafx.tk.quantum.QuantumClipboard.putContent(QuantumClipboard.java:513)

    at javafx.scene.input.Clipboard.setContent(Clipboard.java:230)

    (1) what should be the DataFormat used to be able to drag and drop multiple lines? Looks like we don't have for the type of object, so I created the following which does not solve the problem.

    private DataFormat dataFormat = new DataFormat ("subListPlayers");

    (2) I made changes to support serialization on the data object that seems no more to solve the problem. Tried by implementing the interface Serializable, as well as the implementation of the Externalize interface.

    Can someone Guide please if there is an easy way to implement this behavior?

    Code:

    
    

    public class player

    {

    private String name;

    public player (String name)

    {

    myIdName = name;

    }

    public String getName()

    {

    return the name.

    }

    public void setName (String name)

    {

    myIdName = name;

    }

    @Override

    public boolean equals (Object o)

    {

    If (this == o) return true;

    If (o == null | getClass()! = o.getClass ()) return false;

    A player = o (player);

    If (name! = null? name.equals (player.name): player.name! = null) return false;

    Returns true;

    }

    @Override

    public int hashCode()

    {

    return the name of! = null? name.hashCode (): 0;

    }

    }

    SerializableAttribute public class JavaFXDnDApplication extends Application

    {

    private final static ListView < drive > playersListView = new ListView < drive > ();

    private final static ObservableList < drive > /playerslist is FXCollections.observableArrayList ();.

    private final static ListView < drive > teamListView = new ListView < drive > ();

    private final static GridPane rootPane = new GridPane();

    private DataFormat dataFormat = new DataFormat ("subListPlayers");

    Public Shared Sub main (String [] args)

    {

    Launch (args);

    }

    @Override

    public void start (point primaryStage)

    {

    primaryStage.setTitle ("Drag and Drop Application");

    initializeComponents();

    initializeListeners();

    buildGUI();

    populateData();

    primaryStage.setScene (new scene (rootPane, 400, 325));

    primaryStage.show ();

    }

    Private Sub initializeListeners()

    {

    playersListView.setOnDragDetected (new EventHandler < MouseEvent >)

    {

    @Override

    public void handle (event MouseEvent)

    {

    System.out.println ("setOnDragDetected");

    Dragboard dragBoard = (TransferMode.MOVE) playersListView.startDragAndDrop;

    ClipboardContent content = new ClipboardContent();

    content.putString (playersListView.getSelectionModel () .getSelectedItem () .getName ());

    Content.put (dataFormat, playersListView.getSelectionModel () .getSelectedItems ());

    dragBoard.setContent (content);

    }

    });

    teamListView.setOnDragOver (new EventHandler < DragEvent >)

    {

    @Override

    public void handle (DragEvent dragEvent)

    {

    dragEvent.acceptTransferModes (TransferMode.MOVE);

    }

    });

    teamListView.setOnDragDropped (new EventHandler < DragEvent >)

    {

    @Override

    public void handle (DragEvent dragEvent)

    {

    String player = dragEvent.getDragboard () .getString ();

    ObservableList < drive > drive = dragEvent.getDragboard () .getContent (dataFormat) (< drive > ObservableList);

    String player = dragEvent.getDragboard () .getString ();

    teamListView.getItems () .addAll (New Player (player));

    playersList.remove (new Player (player));

    dragEvent.setDropCompleted (true);

    }

    });

    }

    Private Sub buildGUI()

    {

    rootPane.setGridLinesVisible (true);

    rootPane.setPadding (new Insets (10));

    rootPane.setPrefHeight (30);

    rootPane.setPrefWidth (100);

    rootPane.setVgap (20);

    rootPane.setHgap (20);

    rootPane.add (playersListView, 0, 0);

    rootPane.add (teamListView, 1, 0);

    }

    Private Sub populateData()

    {

    () playersList.addAll

    New Player("Adam"), New Player("Alex"), Player ("Alfred") New Player("Albert") new,.

    New Player("Brenda"), New Player("Connie"), Player ("Derek") new new Player ("Donny").

    Player ("Lynne") new, New Player ("Myrtle"), Player ("pink") New Player("Rudolph") new,.

    Player("Tony") new, New Player ("Trudy"), Player ("Williams") New Player ("Zach") new

    );

    playersListView.setItems (playersList);

    }

    Private Sub initializeComponents()

    {

    playersListView.setPrefSize (250, 290);

    playersListView.setEditable (true);

    playersListView.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);

    playersListView.setCellFactory (new reminder < < drive > ListView, ListCell < drive > > ())

    {

    @Override

    public call for ListCell < drive > (ListView < drive > playerListView)

    {

    return again ListCell < drive >)

    {

    @Override

    protected void updateItem (player, boolean b)

    {

    super.updateItem (reader, b);

    If (player! = null)

    {

    setText (player.getName ());

    }

    }

    };

    }

    });

    teamListView.setPrefSize (250, 290);

    teamListView.setEditable (true);

    teamListView.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);

    teamListView.setCellFactory (new reminder < < drive > ListView, ListCell < drive > > ())

    {

    @Override

    public call for ListCell < drive > (ListView < drive > playerListView)

    {

    return again ListCell < drive >)

    {

    @Override

    protected void updateItem (player, boolean b)

    {

    super.updateItem (reader, b);

    If (player! = null)

    {

    setText (player.getName ());

    }

    }

    };

    }

    });

    }

    }

    
    

    Yes, it is a pain. I filed https://javafx-jira.kenai.com/browse/RT-29082 earlier. Go ahead and vote in favour if you're inclined...

    I think that the problem in your case, it is the observable list provided by MultipleSelectionModel.getSelectedItems () is not serializable. So even if you make your player Serializable class, the list is not. The first thing I would try, I think, is to make player implements Serializable and pass in an ArrayList instead of the observable list. If you can do

    content.put(dataFormat, new ArrayList(playersListView.getSelectionModel().getSelectedItems()));
    

    and

    List player = (List) dragEvent.getDragboard().getContent(dataFormat);
    teamListView.getItems().addAll(player);
    

    If it does not, a solution is simply to store the "slipped" into a property list:

    final ListProperty draggedPlayers = new SimpleListProperty();
    //...
    // Drag detected handler:
    content.putString("players");
    draggedPlayers.set(playersListView.getSelectionMode().getSelectedItems());
    
    // Drag dropped handler:
    if (dragboard.hasString() && dragboard.getString().equals("players")) {
         teamListView.getItems().addAll(draggedPlayers.get());
         draggedPlayers.set(null);
    }
    
  • How to drag and drop nodes to tab between the components of the tab

    I'm working on this tutorial example ( feature drag - move in the JavaFX Applications |) JavaFX tutorials and Documentation 2 ). Based on the tutorial I want to drag tabs between two tabs. So far, I have managed to create this code, but I need help to complete the code.

    Source

    tabPane = new TabPane();
    Tab tabA = new Tab();
       Label tabALabel = new Label("Main Component");
    
    
    tabPane.setOnDragDetected(new EventHandler<MouseEvent>()
            {
                @Override
                public void handle(MouseEvent event)
                {
                    /* drag was detected, start drag-and-drop gesture*/
                    System.out.println("onDragDetected");
    
                    /* allow any transfer mode */
                    Dragboard db = tabPane.startDragAndDrop(TransferMode.ANY);
    
                    /* put a string on dragboard */
                    ClipboardContent content = new ClipboardContent();
                    content.put(DataFormat.PLAIN_TEXT, tabPane);
                    db.setContent(content);
    
                    event.consume();
                }
            });
    

    What is the correct way to insert the contents of the tab as an object? In the tutorial simple text is transferred. How do I change this line content.put(DataFormat.PLAIN_TEXT, tabPane); ?

    And what is the right way to insert the tab after that I drag the tab:

    Destination


    tabPane.setOnDragDropped(new EventHandler<DragEvent>()
            {
                @Override
                public void handle(DragEvent event)
                {
                    /* data dropped */
                    /* if there is a string data on dragboard, read it and use it */
                    Dragboard db = event.getDragboard();
                    boolean success = false;
                    if (db.hasString())
                    {
                        //tabPane.setText(db.getString());
                        Tab tabC = new Tab();
                        tabPane.getTabs().add(tabC);
                        success = true;
                    }
                    /* let the source know whether the string was successfully
                     * transferred and used */
                    event.setDropCompleted(success);
    
                    event.consume();
                }
            });
    



    I guess that this transfer is possible?

    REF javafx 2 - How to drag and drop nodes between the components of the tab - stack overflow tab

    I use a graphic (instead of text) for tabs and call setOnDragDetected on this chart. That way you know which tab is moved. There is no nice way to put the tab itself in the dragboard because it is not serializable (see https://javafx-jira.kenai.com/browse/RT-29082), so you'll want to probably just store currently slipped into a property tab.

    Here's a quick example; It only add the tab at the end of the existing tabs in the pane has fallen. If you want to insert it in the location that is closest to the actual drop you probably browse the tabs and find details of chart of each tab, or something.

    import java.util.Random;
    
    import javafx.application.Application;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.SimpleObjectProperty;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.Tab;
    import javafx.scene.control.TabPane;
    import javafx.scene.input.ClipboardContent;
    import javafx.scene.input.DragEvent;
    import javafx.scene.input.Dragboard;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.input.TransferMode;
    import javafx.scene.layout.StackPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    
    public class DraggingTabPane extends Application {
    
      private static final String TAB_DRAG_KEY = "tab" ;
      private ObjectProperty draggingTab ;
    
    @Override
      public void start(Stage primaryStage) {
      draggingTab = new SimpleObjectProperty<>();
      TabPane tabPane1 = createTabPane();
      TabPane tabPane2 = createTabPane();
      VBox root = new VBox(10);
      root.getChildren().addAll(tabPane1, tabPane2);
    
      final Random rng = new Random();
      for (int i=1; i<=8; i++) {
        final Tab tab = createTab("Tab "+i);
        final StackPane pane = new StackPane();
          int red = rng.nextInt(256);
          int green = rng.nextInt(256);
          int blue = rng.nextInt(256);
        String style = String.format("-fx-background-color: rgb(%d, %d, %d);", red, green, blue);
        pane.setStyle(style);
        final Label label = new Label("This is tab "+i);
        label.setStyle(String.format("-fx-text-fill: rgb(%d, %d, %d);", 256-red, 256-green, 256-blue));
        pane.getChildren().add(label);
        pane.setMinWidth(600);
        pane.setMinHeight(250);
        tab.setContent(pane);
        if (i<=4) {
          tabPane1.getTabs().add(tab);
        } else {
          tabPane2.getTabs().add(tab);
        }
      }
    
      primaryStage.setScene(new Scene(root, 600, 600));
      primaryStage.show();
      }
    
      public static void main(String[] args) {
      launch(args);
      }
    
      private TabPane createTabPane() {
        final TabPane tabPane = new TabPane();
        tabPane.setOnDragOver(new EventHandler() {
          @Override
          public void handle(DragEvent event) {
            final Dragboard dragboard = event.getDragboard();
            if (dragboard.hasString()
                && TAB_DRAG_KEY.equals(dragboard.getString())
                && draggingTab.get() != null
                && draggingTab.get().getTabPane() != tabPane) {
              event.acceptTransferModes(TransferMode.MOVE);
              event.consume();
            }
          }
        });
        tabPane.setOnDragDropped(new EventHandler() {
          @Override
          public void handle(DragEvent event) {
            final Dragboard dragboard = event.getDragboard();
            if (dragboard.hasString()
                && TAB_DRAG_KEY.equals(dragboard.getString())
                && draggingTab.get() != null
                && draggingTab.get().getTabPane() != tabPane) {
              final Tab tab = draggingTab.get();
              tab.getTabPane().getTabs().remove(tab);
              tabPane.getTabs().add(tab);
              event.setDropCompleted(true);
              draggingTab.set(null);
              event.consume();
            }
          }
        });
        return tabPane ;
      }
    
      private Tab createTab(String text) {
        final Tab tab = new Tab();
        final Label label = new Label(text);
        tab.setGraphic(label);
        label.setOnDragDetected(new EventHandler() {
          @Override
          public void handle(MouseEvent event) {
            Dragboard dragboard = label.startDragAndDrop(TransferMode.MOVE);
            ClipboardContent clipboardContent = new ClipboardContent();
            clipboardContent.putString(TAB_DRAG_KEY);
            dragboard.setContent(clipboardContent);
            draggingTab.set(tab);
            event.consume();
          }
        });
        return tab ;
      }
    }
    
  • How to drag and drop the &lt; af:inputNumberSpinbox &gt; in Control Panel

    Hello

    I use jdev 11.1.1.4.0

    I need the component as < af:inputNumberSpinbox >. Create a data model and how to drag and drop into the inputNumberSpinbox of the data control.
    normally drog and drop the individual attribute as inputText box only. I want to < af:inputNumberSpinbox >.

    anythig want to change in the indicators of control view object itself. Help me.

    Kind regards
    Marilyn S.

    Published by: rami on June 22, 2011 16:45

    Hello

    Cannot drop you as an inputText and then change to the source for inputNumberSpinbox?

    Kind regards
    Stijn.

  • With the help of Hewlett Packard Win 7 64 bit with Lightroom 5.7. I have read many explanations of how to drag and drop digital images in Lightroom - but I never got.  I need to know WHERE LTRM drop, HOW to find them and how to get them I

    I need to know EXACTLY how to drag and drop digital pictures into LTRM. WHERE to put them. HOW to find them. How to MOVE in the DEVELOPMENT MODULE.

    When you drag / drop photos, you actually perform a step to import, so it would be wise to figure out how to import your photos and all of the affected options. I agree with Jim Hess and al., drag / drop are an easy way to screw up your organization. Importing is a much more organized way to manage things. There are a lot of tutorial vid3os on import.

  • How to drag and drop an action on a workflow?

    How to pass the variable page ADF bind View object John says that

    You should also consider dragging operation executeWithParams on your workflow and of wiring to occur before your page instead of in the definition on the page itself - so it is more clear what is happening and is the approach recommended for 11 g applications. When drag-and you - drop operation, you can use the dialog box bind the parameter to your page flow - scope variable by providing the good EL there.

    How can I drag and drop the executeWithParams on a workflow method. I use 11.1.1.5.0 on LINUX?

    I assume that I need an action method in my flow of the page.

    I have the following action defined in my def of page file:

    < action IterBinding = "localizedCustomerHierarchyViewIterator".
    ID = "executeQueryWithParamsForLocalizedCustomerHierarchyView".
    InstanceName = "BusinessRulesAMDataControl.LocalizedCustomerHierarchyView"
    DataControl = "BusinessRulesAMDataControl" RequiresUpdateModel = "true".
    Action = "executeWithParams" >
    < NamedData NDName = "RootEntityId".
    NDValue = "#{pageFlowScope.recommendationRule.customerEntityId" "
    NDType = "java.lang.Long" NDOption = "3" / > "
    < NamedData NDName = 'language '.
    NDValue = "#{pageFlowScope.recommendationRule.language} '"
    NDType = "java.lang.String" NDOption = "3" / > "
    < / action >

    Just do drag and drop in the schema, see the demo here:
    http://blogs.Oracle.com/Shay/entry/passing_parameters_to_adf_appl

  • Newbie request for assistance with several drag-and-drop &amp; multiple targets

    I know that this question has been asked a million times, but I get always very well the solution.  I know that the solution called for me the use of tables in a part of my code, but I have problems understanding how to implement it.  I use Flash CS 5.5 with AS3.

    I have a flash drag-and-drop file which is divided into 4 distinct zones on the stage.  On each box, there are 7 places, for 7 different "puzzle pieces".  The first two spaces on each quadrant have very a very specific order for the correct puzzle pieces, while the 5 additional places on each quadrant also have specific parts, but the order is not important.  I have included my code below for reference (note that I have not all instances, finished yet).

    Basically, in code that's been created, the following bodies have specific targets with specific command:

    D1_1_mc, D1_2_mc, D1_1_mc, D2_2_mc, D3_1_mc, D3_2_mc, D4_1_mc and D4_2_mc.

    All other instances, such as D1_3_mc, D2_3_mc, D2_4_mc, etc. have specific quadrants on which they need to fall, but what about the last 5 'spaces' in each quadrant, the order does not matter.  I know that I can continue to do what I do, but I would have preferred that the last 5 pieces on each quandrant do not have to be in a specific order.

    You can provide any assistance is greatly appreciated!

    var startX:Number;

    var startY: number;

    var counter: Number = 0;

    D1_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D1_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D1_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D1_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D1_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D1_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D2_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D2_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D2_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D2_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D2_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D2_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D2_4_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D2_4_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D3_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D3_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D3_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D3_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D3_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D3_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D4_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D4_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D4_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D4_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D4_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D4_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D4_4_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D4_4_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    function pickUp(event:MouseEvent):void {}

    event.target.startDrag (true);

    reply_txt. Text = "";

    event.target.parent.addChild (event.target);

    startX = event.target.x;

    startY = event.target.y;

    }

    function dropIt(event:MouseEvent):void {}

    event.target.stopDrag ();

    var myTargetName:String = "target_" + event.target.name;

    var myTarget:DisplayObject = getChildByName (myTargetName);

    If (event.target.dropTarget! = null & & event.target.dropTarget.parent == myTarget) {}

    reply_txt. Text = "Good Job!"

    event.target.removeEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    event.target.removeEventListener (MouseEvent.MOUSE_UP, dropIt);

    event.target.buttonMode = false;

    Event.Target.x = myTarget.x;

    Event.Target.y = myTarget.y;

    counter ++;

    } else {}

    reply_txt. Text = "Try Again!";

    Event.Target.x = startX;

    Event.Target.y = startY;

    }

    if(Counter == 5) {}

    reply_txt. Text = "congratulations, you did!"

    }

    }

    D1_1_mc.buttonMode = true;

    D1_2_mc.buttonMode = true;

    D1_3_mc.buttonMode = true;

    D2_1_mc.buttonMode = true;

    D2_2_mc.buttonMode = true;

    D2_3_mc.buttonMode = true;

    D2_4_mc.buttonMode = true;

    D3_1_mc.buttonMode = true;

    D3_2_mc.buttonMode = true;

    D3_2_mc.buttonMode = true;

    D4_1_mc.buttonMode = true;

    D4_2_mc.buttonMode = true;

    D4_3_mc.buttonMode = true;

    D4_4_mc.buttonMode = true;

    Since it seems to afew possible gaps in the code you showed, and what I offer myself in response to your questions, I spent a little time get a working model of what I guess you just using the three targets and the fall of four objects.  If you want, I can make the file available for you, but for now, here's the code that works...

    var startX:Number;
    var startY: number;
    var counter: Number = 0;

    target_D2_1_mc.allowed = new Array (D2_1_mc);
    target_D2_2_mc.allowed = new Array (D2_2_mc);
    target_D2_3_mc.allowed = new Array (D2_3_mc, D2_4_mc);

    D2_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    D2_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);
    D2_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    D2_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);
    D2_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    D2_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);
    D2_4_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    D2_4_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    function pickUp(event:MouseEvent):void {}

    reply_txt. Text = "Good Luck."
    event.target.startDrag (true);
    event.target.parent.addChild (event.target);
    startX = event.target.x;
    startY = event.target.y;
    }

    function dropIt(event:MouseEvent):void {}

    event.target.stopDrag ();

    If (event.target.dropTarget! = null & MovieClip (event.target.dropTarget.parent).allowed.indexOf (event.target) >-1) {}
    reply_txt. Text = "Good Job!"
    event.target.removeEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    event.target.removeEventListener (MouseEvent.MOUSE_UP, dropIt);
    event.target.buttonMode = false;
    Event.Target.x = MovieClip (event.target.dropTarget.parent) .x;
    Event.Target.y = there MovieClip (event.target.dropTarget.parent);
    counter ++;
    } else {}
    reply_txt. Text = "Try Again!";
    Event.Target.x = startX;
    Event.Target.y = startY;
    }

    if(Counter == 5) {}
    reply_txt. Text = "congratulations, you did!"
    }
    }

    D2_1_mc.buttonMode = true;
    D2_2_mc.buttonMode = true;
    D2_3_mc.buttonMode = true;
    D2_4_mc.buttonMode = true;

  • Virtual PC for Windows 7 - How to drag-and - drop or transfer files

    I am trying to use Virtual PC for Windows 7 and be able to identify ways to transfer files from my host system in a virtual PC, I created.

    I was previously using Virtual PC (VPC) 2007 under Vista and am familiar with just the files dragging and droping to and from my host on the virtual computer system.

    I enabled the integration services and am unsure of what the user really wants that the VPC. that is he doesn't want configure me a Local user on the virtual machine or the host.

    I was able to connect to the virtual computer by using a local user on the computer virtual account, but for the life of me can not find out how to transfer files that I used to.

    To achieve what I need, I copy files to a shared location on my network as my PC and the virtual computer has access.

    Can anyone suggest how to get the 'integration' works correctly then drag and drop files between the Bureau of the VPC and host is possible.

    Thank you.

    Integration features allows the WVPC7 to share resources and readers. Open the virtual machine settings, and these options are available:

    1. Audio. Without integration, sounds played inside the virtual machine are emulated using a SoundBlaster 16 card. Audio output is fairly shrill and unpleasant to play using MP3s that imitated the sound card. With audio integration, sounds inside the VM are routed via Protocol Office remotely to your physical card. Audio output will be much better.
    2. Clipboard. Host OS and guest OS supported can share contents of the Clipboard.
    3. Printer. Applications within the virtual machine can print using your physical printer. This is useful if you have a parallel printer (LPT1). For USB printers, click on the "USB" menu on the toolbar of the virtual machine monitor, then attach your USB printer to your virtual machine.
    4. Smart cards. (I do not have any device of smart card, experts, please answer)
    5. Readers. Guest operating system can access and write files directly to your physical hard disks (or DVD or USB flash disk drive); is based on the physical disks, you have shared.

    For drag / drop, until today (2 July here) does not. I used to drag-and - drop files from my desktop windows vista to the desktop of the virtual machine (windows XP inside) you do, but now we can't. Another approach is to share your disks in has integration of options described above.

    After I shared my C: drive, a new 'shared' drive appeared in my virtual Windows XP [workstation], which is 'C on RYAN-PC' (the name may be different on your PC). Whenever I need to copy some files from my virtual computer on the desk of my windows 7, I just opened that shared drive, navigate to \\tsclient\C\Users\Ryan\Desktop\, copy the files and they come to my office windows 7.

    Personally I agree that even this method is simpler that the copy of the shared network files, drag-and - drop is much easier.

  • Drag and drop small objects of MC

    I build a project with dots (6 X 6) as the user drags/drops on a part of the scene. These should be small, but "understandable" with the pointer of the mouse (or platforms key activated using a stylus point). I tried, unsuccessfully so far, to create these as MC inside the largest (14 X 14) points (also MC) alpha value of 0 so the greater surrounding area does not show, but would catch the smallest point MC inside. So far, does not work. The smallest point train/drops OK, but the top layer more transparent alpha of the MC shows no sign of being caught. Not sure if it is possible to drag and drop. Essentially, what I'm trying to do is set up a handful of surrounding transparent grag to facilitate the smallest point drag and drop without obstructing the area/view on which it must be positioned/deleted. Prefer not to use an element of third party for the transformation handles, if possible.

    Maybe there's a better way to do it?

    Specific measures / suggestions to achieve this, appreciated.

    Here is a link to a sample file that does what you described as creating movable objects going - out of alpha-ed more big piece while the other is not... the two slide correctly.

    http://www.nedwebs.com/Flash/AS3_Drag_alpha.fla

  • Drag and Drop 2 objects 1 target

    I'm relatively new to Flash and try to create a drag and drop.  I followed the tutorial here (http://monkeyflash.com/tutorials/flash-drag-and-drop/). A change that I made this tutorial was having the object disappear when it is deposited on the target.  By following these instructions, I was able to build a drag and drop of an object to a target successfully.  My question is what do I do if I want to have several items to go to the same target?  For example in the tutorial that happens if I added a second square object and both wanted to go to a target square.

    Any help would be greatly appreciated!

    As long as the target is always available as a target, you can drag to as many objects as you want (one at a time).  To help do that, when you drop an object on the target and make disappear, either to do this object fall go far (removeChild (dropped)) so that it does not block the path or move the target above the object dropped (addChild (target)).

  • How to drag and drop photos to photos on memory stick

    seems I can is no longer just drag and drop photos on memory stick of my mac progesterone... .any suggestions?

    I don't know your problem makes the impression that I do not understand the relevance of female hormones.

  • Can someone please tell me how to drag and drop images of the pictures Mac (using Yosemite OS) program to 5.7 Lightroom?  Thank you.

    I just got a new computer and uses pictures instead of iPhoto for cataloging my images.  I would like to use Lightroom 5.7 for an editing tool, but I'm frustrated that I can't drag and drop the images I want to change?  Any ideas?

    Hi tamia82374570,

    Greetings.

    In my view, it is not possible that you are trying to import images from one application to another.

    • You will need to first export of photo images in a folder on the desktop or any other location
    • Then open LR, click Import and navigate to this location in the source Panel and import the images in LR.

    Concerning

    Rohit

  • How to drag and drop items in the Muse...

    Hello: Im attemping to create some drag and drop elements in muse. Can someone help me with this? Thank you

    You cannot create drag and then drop items using the off the features of the mailbox Muse. You may need to use some third-party JS library and integrate code using InsertHTML or HTML foroptions of Muse.

    Thank you

    Vikas

  • If I drag and drop an object in a box. When the timeline returns like that, I want the object to remain in the area and restores not where it was originally.

    Hi all, this is my first post here. Very happy to be here.

    I created an interaction by which objects can be dragged and got stuck in a box. Never, I solved the problem when the playhead returned items I looked where I had left. I did it with as2 and never solved the problem which I am sure is easy enough to solve. I remember someone saying something about levels.

    I need to create an interaction where objects are put in a box and they stay there until the interaction ends. Say that the objects are in a room where the user must visit several times in the interaction. There must be a certain number of objects in the room and drag them into a box to get a done message, I want the user to be able to move to another part of my interaction and come back and be able to complete the conclusion and place the objects in the box without reset everything to where they were first encountered user them.

    I have wi

    All advice, tips are greatly appreciated.

    Looks like you need to add programming that 1) stores the x / y locations of the objects since they change 2) uses this information in position to position objects whenever you enter the picture that they are in.

    You should be able to create variables to store the information that is on a layer that extends from the complete timeline so that the data is stored as it is updated and you move along the timeline.  When you move the object update you its position data. Then, in the context where you have objects use you a simple coding to place objects using this position info... something as simple as...

    Object1.x = object1X;

    Object1.y = object1Y;

    If you are still using AS1/2 you would use _x and FLF instead of x and y

Maybe you are looking for