Rotate and move multiple objects

Hiya!
I'm looking for a way for the user to be able to freely move
by clicking and dragging objects and also have the ability for the
user to rotate that object once in place. Any ideas, dudes?

Look into startDrag(), stopDrag(), and the _rotation property
(rotation if you're using AS3).

Similar Messages

  • Move multiple objects with on click

    Hi there
    I am using Greensocks TweenMax to try and move multiple object across the screen with the onclick function. My code is not showing up errors and my Elements are at the front of the page but nothing happens when I click the element
    Here is my code, any help would be appricated
    // insert code for mouse click here
    TweenMax.to(sym.$("Geyser_Pic"), 1, {css:{right:"0px"}, ease:Expo.easeout});
    TweenMax.to(sym.$("Volcano"), 1, {css:{right:"150px"}, ease:Expo.easeout});
    TweenMax.to(sym.$("HotSpring"), 1, {css:{right:"100px"}, ease:Expo.easeout});

    Since you are saying you do not see any errors in the browser console,
    see if your click event is actually getting trigerred.Add a alert in the click event listener.
    If the event is getting trigerred,can you share or private message me your files .I will try to nail the issue.

  • Select and move multiple keyframs

    I just switched from Adobe Premier Elements on a PC to FCE 4. In PrEl, you can select multiple keyframes in their equivalent of the Viewer, you can them move them as a group. (Select them shift click or drag a square around them.)
    This is really useful for changing the timing of motion, i.e., if you decide that you'd like the motion to take a little longer etc.
    it also lets you move them to a different time w/out rick of changing the values in the overlay.
    I can't figure out a way to do this in FCE, is there a hidden way or something I'm missing?
    thanks

    I'd like to be able to stretch out a motion. For example, I scale in a photo. But I later decide the scaling should take 8 seconds rather than 5. I'd like to grab the 2nd keyframe for scale and rotation and move them both equally 3 seconds later.
    I believe moving a motion path just changes its position, but doesn't affect it's duration.

  • Rotate and move image

    Hi,I'm trying to make a game kinda like gta or asteroids whereyou have top view. I am using an image to be the player and, I want to rotate that image using left and righ keys and with the up key move the player to the direction whereit is rotated.
    The problem is that i cannot display the rotation and movement at the same time.
    I'm using a code like this.
    AffineTransform transform = new AffineTransform
    public void checkGameInput(){
         float velocityX=0;
         float velocityY=0;
         if(rotateLeft.isPressed()){
               angle1+=angle2;    
              transform.rotate(-angle2, player.getWidth()/2, player.getHeight()/2);
    // similar for rightkey
       if (moveFront.isPressed()){
               velocityX=_Player.SPEED*Math.cos(angle1),
               //same for velocityY
    }the problem is when i try to print on the sceen.
    I can update position
    public void draw(Graphics 2D g){
    g.drawImage(player. getImage(), Math.round(player.getX()), Math.round(player.getY()),null)  // player.getX(9 returns position of playeror update rtation
    public void draw(Graphics 2D g){
    g.drawImage(player.getImage(),transform, null);is there a way to join this to drawImageso I can rotate ane move the rotatyed image?
    thank you very much for any kind of help.
    Edited by: Muninn on Nov 29, 2008 3:13 AM

    Use the transform to do both rotation and translation (multiple transform operations can be concatenated)
    transform.rotate(-angle2, player.getWidth()/2, player.getHeight()/2);
    transform.translate(player.getX(), player.getY());

  • Would like to be able to select and move multiple folders in one operation.

    Unless I'm missing something really simple here, there doesn't seem to be any easy way of selecting and moving multiple folders at once.
    Here's a little example of a simple task I want to do. I presently have a multitude of folders each seperated by the day the photo was taken on. So in my case for a given year I might have maybe 50 folders or so. It's getting a little cluttered, so all I want to be able to do is to take all the folders for one given year and place them in a folder with that year's date. This should be a simple 30 second task, simply select the folders I want moved by either <CTRL> or <SHIFT> clicking them, and then dragging and dropping them into the new folder.
    Right now, the only way I've figured how to do this this is to drag and drop each folder one by one, never mind that this is a slow process in itself, but to add to the slowness, whenever I try to drag and drop more than one folder consecutively, I get a message saying ... "Can not move a folder while another move operation is in progress...blah blah". Not that I want this to be the fix, but haven't they heard of queuing?
    I've seen people on the net suggest that for this type of task, you should simply move the folders in Windows first and then locate them in Lightroom. Again, unless I'm missing something very simple here, there doesn't seem to be a way to locate multiple missing folders at once. If I have to manually locate each missing folder one by one, then I'd rather just do the drag and drop thing as this would actually be faster.
    I've also tried moving the folders from within Windows first and then using the "Synchronize folder" option, yeah sure this works, but I lose any changes that I've done in Develop module. Not what I'm looking for.

    Daniel is right. It´s really strange that I can´t move several folders in one move! When I need more space on my laptop I move a group of folders (one folder for every photosession) to an archive. Therefore I really would like to move them in one click, not "baby-sitting" the move of each folder.

  • How to rotate and translate an object at the same time??

    Hi, I have a problem with rotation and translation of an object at the same time. I wrote a behovior class for my object (a cylinder). When some conditions are true the cylinder is added to a robot arm. Then it is translated so that the cylinder would be very close to the arm (looks like the robot is holding it). And now the behavior should also rotate the cylinder because the angle is 0 and it should be 90. I can translate the object or I can rotate the object but when I'm trying to do it at the same time (I want to combine rotation and translation) it doesn't work.
    Could anyone help me, please :)

    You can used to Matrix3f
    This object is a rotation and translate matrix
    for example:
    private void componerTransformada(){
    Quat4f rot = new Quat4f((float) this.getRotacionSobreX(),(float) this.getRotacionSobreY(),
    (float) this.getRotacionSobreZ(),1.0f);
    Vector3f tras = new Vector3f(-4.0f,-4.0f,(-1)*this.getDistanciaDeLaCamara());
    this.setTransformacion(new Transform3D(new Matrix4f(rot, tras, 1.0f)));
    Quat4f is a matrix of ratation
    vector3f is a direction vector
    Transform3d is building with Quat4f and Vector3f.
    That is work i use this to situe the view of point.
    good locky

  • In Acrobat XI, how can I select and move multiple text/image blocks simultaneously on the same page?

    I work with student-generated PDFs that require all content to be within a specific margin range. Occasionally tables and figures are indented or otherwise spaced incorrectly so that the content violates the margin requirements. In Acrobat X, I could use the select tool to draw a select box around all of the text and lines within a table, for example, and just slide the entire table over a bit to meet the requirements without sending the PDF back to the author for a correction. This didn't always work, but often enough that I was able to use it on a daily basis.
    Is there a way to select multiple (but not ALL) text blocks and image pieces on a page, so they may be moved simultaneously? If I have to select every text block and line (or every point and line within a graph) and move them each individually, this is going to be a nightmare.
    I have Acrobat XI for both Mac and Windows, but tend to use the Windows version more often.

    Hey, I'm using Acrobat XI and I can't multi select like I use too do with shift as always. Now I get a green note every time I want to multi select with shift + click as always. I also use Pitstop and I get the same green notes.
    Can someone help me ?

  • Select and move multiple events at once

    I´m trying to find a command who let me select and move/drag several events for example 15 min down/later in the day. Maybe I have dreamt it but I think I have used ealier a command where I could use this forgotten command and by pressing down the left mouse click over the events I could select the events at once. I think this is much easier than command + click all the individual events. Next question is, how can I move several event at once. I have tried control + arrow down but that only lets me move one individual event. Not multiple, even if I have marked several. I don´t won´t to copy paste. Since I think this is a slower procedure. I´m pretty sure I have done this the "right" way before but could someone remind me of how it should be done I would be very thankful!

    Hi everybody - thanks for using my tip BUT BE AWARE!!!!
    The move function in the current iMovie 09 version STILL has a very serious bug.
    Whenever you move an event to a different disc, iMovie loses the Favourite/Reject and Keyword information. This can be a real drama when you rely on this information and find out that all this info has gone on the new disc.
    There is ANOTHER workaround though (sigh). You Select multiple events (like described in my tip before) and then you do COPY (and not move).
    Then you have duplicate events and you can delete the original. But the metadata will be present in the copy. I just found this solution in this thread
    http://discussions.apple.com/thread.jspa?messageID=11854650#11854650
    thanks harryfear
    cheers
    gfisch

  • Rotate and Move

    Any chance 11g will have rotate and offset (move) functions?
    I wrote my own several years ago - but people I talk with are somewhat puzzled why 10gR2 still doesn't have these two basic spatial functions.

    I have started an "SDO Enrichment Project" out on Sourceforge. One of the first things up there is my current SDO_UTIL_PLUS package, which includes the above move and rotate functions.
    I hope to get some community involvement, and plan to add more packages and functions as time allows (copy from current source, improve documents, etc.).
    Enjoy...
    https://sourceforge.net/projects/oracle-sdo/

  • Drag select and move multiple items

    Hi there,
    I'm currently creating a word game where I would like to place tiles, but if possible I need it to be possible to drag select groups of tiles (preferably with a visible selection box as you drag) and move them around all together.. is there a simple way to implement this and still have the tiles snap to a grid ?
    Many Thanks in advance
    Martin

    you can reparent your selected group to a new parent and drag the parent.

  • Image Rotation and 3D/2D objects

    Hello Group,
    I have a continuing question that has yet to be answered. I
    have two other posts (sorry for multiple posting), with the same
    topic, but, alas, no one seems to like my topic. Perhaps this topic
    is not a Flash topic? Being very new to flash, I am not quite sure
    where to look for answers. If this is the incorrect forum to post
    this topic please advise.
    my topic is below:
    I would like to create (assuming Flash is the correct tool
    for this) a 3D-like rotateable image.
    There is a good example of what I would like to re-create at:
    http://cingular.com, here the user
    can select a cell phone,
    see an image of the phone and select a 360 degree demo of the
    phone, where you can open it, see the top, see the
    bottom, and rotate the phone from side to side. This is done
    using the mouse, etc.
    I checked the source code for the site, and see that they are
    using a *.swf file. Of course, they may not have used Flash to
    create this object, but some other tool, that exports to Flash.
    Any ideas on how to do this type of graphics??
    Thanks
    eholz1

    Hello Group,
    I have a continuing question that has yet to be answered. I
    have two other posts (sorry for multiple posting), with the same
    topic, but, alas, no one seems to like my topic. Perhaps this topic
    is not a Flash topic? Being very new to flash, I am not quite sure
    where to look for answers. If this is the incorrect forum to post
    this topic please advise.
    my topic is below:
    I would like to create (assuming Flash is the correct tool
    for this) a 3D-like rotateable image.
    There is a good example of what I would like to re-create at:
    http://cingular.com, here the user
    can select a cell phone,
    see an image of the phone and select a 360 degree demo of the
    phone, where you can open it, see the top, see the
    bottom, and rotate the phone from side to side. This is done
    using the mouse, etc.
    I checked the source code for the site, and see that they are
    using a *.swf file. Of course, they may not have used Flash to
    create this object, but some other tool, that exports to Flash.
    Any ideas on how to do this type of graphics??
    Thanks
    eholz1

  • Rotating and Animating an Object

    I'm trying to animate an object so that it rotates counterclockwise up to a certain point but the falls back down to the original postion. Can anybody explain to me how to do this? I've tried using keyframes, but they do not seem to work. Thanks!

    Everytime I move a few frames forward and rotate the car, a key frame is not added. When I play back the video, the car stays in the same position where I left off. Could you also explain why the car does not have a solid look to it? It looks a bit ghostly.
    Where would I find the graph editor? I'm really new to After Effects.

  • Working with images - Rotation and Movement

    Hello there,
    I have this problem that I cant seem to solve:
    I need to be able to move an image arround and there are restrictions to where image should be able to move: at any given time, when dragging, image should always cover whole body of a given border_container, this is simply achieved by sending a rectangle to the startDrag function, which will specify where the image is allowed to move. I got that part right, and its working, the problem arrise when I try to rotate the border_container (with the image), it should still be only possible to drag image so it all the time covers the body of the border_container, but I don't know how to do it.
    Code I use looks something like this:
    image.startDrag(getImageDragRectangle());
    protected function getImageDragRectangle():Rectangle
         return new Rectangle(
              this.width-image.contentWidth + x,
              this.height-image.contentHeight + y,
              Math.abs(this.width-image.contentWidth),
              Math.abs(this.height-image.contentHeight));
    Edit: image is not inside the border_container (not sure how relevant it is..)
    Could anyone help me out here and give me any hints or suggestions how I could fix it?

    You would have to write the image to a temporary file so that the browser could read it off the server. Browsers do not have access to the database, so there's no way to get the image from the database to the browser without using some sort of interim solution.
    ~Jer

  • How do I drag and drop multiple objects in a mask?

    I’ve been working on a flash simulator to show what our night vision product would look like in the dark.  I have been successful in making it work with the following code below.  Yet I cannot add a "reticle" image (or symbol) to the draggable mask to make it work.  Can someone help me with the code?  I looked for hours on the internet and I cannot get it to work.  I am new to Flash but am starting to learn as much as I can.
    Actionscript 3 Code:
    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 (like enterframe) and update the reticle's position to match mask_mc's position.
    mg_nv.mask = mask_mc;
    mask_mc.buttonMode = true;
    // eg, 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 they both have the same reg points (like the center)
    reticle_mc.y=mask_mc.y;

  • Problem in rotating and moving image at the same time

    the problem is that im making a car game(2D) in which u have upper view of car.
    i have make the car rotate bt problem is that i canot move it forward or backward correctly
    .wen i move it forward or backward i goes wrong...
    nd another problem is that i cannot both rotate and move the car at same time
    example if i press both up nd right arrow keys i doesnt move nd rotate..
    nd also plz tell me the accelerate nd reverse method so i can speedup my car like other car games
    here is the code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.applet.*;
    import java.net.URL;
    public class RaceGame extends JComponent
    static int x=560;
    static int y=410;
    static int currentAngle=0;
    static double hspeed,vspeed;
    static int carspeed=1;
    Image car;
    //int angle=car.getAngle();
    Image getImage(String filename)
    URL url = getClass().getResource(filename);
    ImageIcon icon = new ImageIcon(url);
    return icon.getImage();
    //Rectangle2D.Float rect=new Rectangle2D.Float(x,y,30,30);
    //Rectangle rect=new Rectangle(x,y,30,30);
    public RaceGame()
    car=getImage("car1.jpeg");
    public void CreateBase()
    JFrame frame=new JFrame("Dare2Race");
    frame.setBounds(70,30,650,500);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container c=frame.getContentPane();
    c.add(new RaceGame());
    frame.addKeyListener(new adapter());
    c.setBackground(Color.BLACK);
    //JLabel finish=new JLabel("FINISH");
    //c.add(finish);
    public void rotate()
    currentAngle+=1;
    if(currentAngle>=360)
    currentAngle=0;
    repaint();
    public void paint(Graphics g)
    super.paint(g);
    Graphics2D g2d=(Graphics2D)g;
    AffineTransform origXform=g2d.getTransform();
    AffineTransform newXform=(AffineTransform)(origXform.clone());
    newXform.rotate(Math.toRadians(currentAngle),x,y);
    g2d.setTransform(newXform);
    g2d.drawImage(car,x,y,this);
    g2d.setTransform(origXform);
    g.setColor(Color.WHITE);
    g.drawLine(640,380,420,380);
    g.drawLine(640,460,320,460);
    g.drawLine(420,380,420,300);
    g.drawLine(320,460,320,380);
    g.drawLine(420,300,125,300);
    g.drawLine(320,380,230,380);
    g.drawLine(230,380,230,460);
    g.drawLine(230,460,2,460);
    g.drawLine(125,300,125,370);
    g.drawLine(125,370,105,370);
    g.drawLine(2,460,2,180);
    g.drawLine(105,370,105,300);
    g.drawLine(2,180,450,180);
    g.drawLine(105,300,105,250);
    g.drawLine(105,250,550,250);
    g.drawLine(550,250,550,20);
    g.drawLine(550,20,275,20);
    g.drawLine(450,180,450,100);
    g.drawLine(450,100,360,100);
    g.drawLine(360,100,360,160);
    g.drawLine(360,160,10,160);
    g.drawLine(10,160,10,30);
    g.drawLine(275,20,275,90);
    g.drawLine(275,90,110,90);
    g.drawLine(110,90,110,30);
    repaint();
    class adapter extends KeyAdapter
    public void keyPressed(KeyEvent e)
    switch(e.getKeyCode())
    case KeyEvent.VK_LEFT:
    currentAngle--;
    repaint();
    break;
    case KeyEvent.VK_RIGHT:
    currentAngle++;
    repaint();
    break;
    case KeyEvent.VK_UP:
    carspeed++;
    hspeed=((double)carspeed)*Math.cos(currentAngle);
    vspeed=((double)carspeed)*Math.sin(currentAngle);
    x = x - (int) hspeed;
    y = y - (int) vspeed;
    repaint();
    break;
    case KeyEvent.VK_DOWN:
    carspeed--;
    hspeed=((double)carspeed)*Math.cos(currentAngle);
    vspeed=((double)carspeed)*Math.sin(currentAngle);
    x = x + (int)hspeed;
    y = y + (int)vspeed;
    repaint();
    break;
    public static void main(String[]args)
    RaceGame race=new RaceGame();
    race.CreateBase();
    //race.setDoubleBuffered(true);
    }

    the problem is that im making a car game(2D) in which u have upper view of car.
    i have make the car rotate bt problem is that i canot move it forward or backward correctly
    .wen i move it forward or backward i goes wrong...
    nd another problem is that i cannot both rotate and move the car at same time
    example if i press both up nd right arrow keys i doesnt move nd rotate..
    nd also plz tell me the accelerate nd reverse method so i can speedup my car like other car games
    plz help me
    here is the code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.applet.*;
    import java.net.URL;
    public class RaceGame extends JComponent
    static int x=560;
    static int  y=410;
    static int currentAngle=0;
    static double hspeed,vspeed;
    static  int carspeed=1;
    Image car;
    //int angle=car.getAngle();
    Image getImage(String filename)
    URL url = getClass().getResource(filename);
    ImageIcon  icon = new ImageIcon(url);   
    return icon.getImage();
    //Rectangle2D.Float rect=new Rectangle2D.Float(x,y,30,30);
    //Rectangle rect=new Rectangle(x,y,30,30);
    public RaceGame()
    car=getImage("car1.jpeg");
    public void CreateBase()
    JFrame frame=new JFrame("Dare2Race");
    frame.setBounds(70,30,650,500);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container c=frame.getContentPane();
    c.add(new RaceGame());
    frame.addKeyListener(new adapter());
    c.setBackground(Color.BLACK);
    //JLabel finish=new JLabel("FINISH");
    //c.add(finish);
    public void rotate()
    currentAngle+=1;
    if(currentAngle>=360)
    currentAngle=0;
    repaint();
    public void paint(Graphics g)
    super.paint(g);
    Graphics2D g2d=(Graphics2D)g;
    AffineTransform origXform=g2d.getTransform();
    AffineTransform newXform=(AffineTransform)(origXform.clone());
    newXform.rotate(Math.toRadians(currentAngle),x,y);
    g2d.setTransform(newXform);
    g2d.drawImage(car,x,y,this);
    g2d.setTransform(origXform);
    g.setColor(Color.WHITE);
    g.drawLine(640,380,420,380);
    g.drawLine(640,460,320,460);
    g.drawLine(420,380,420,300);
    g.drawLine(320,460,320,380);
    g.drawLine(420,300,125,300);
    g.drawLine(320,380,230,380);
    g.drawLine(230,380,230,460);
    g.drawLine(230,460,2,460);
    g.drawLine(125,300,125,370);
    g.drawLine(125,370,105,370);
    g.drawLine(2,460,2,180);
    g.drawLine(105,370,105,300);
    g.drawLine(2,180,450,180);
    g.drawLine(105,300,105,250);
    g.drawLine(105,250,550,250);
    g.drawLine(550,250,550,20);
    g.drawLine(550,20,275,20);
    g.drawLine(450,180,450,100);
    g.drawLine(450,100,360,100);
    g.drawLine(360,100,360,160);
    g.drawLine(360,160,10,160);
    g.drawLine(10,160,10,30);
    g.drawLine(275,20,275,90);
    g.drawLine(275,90,110,90);
    g.drawLine(110,90,110,30);
    repaint();
    class adapter extends KeyAdapter
    public void keyPressed(KeyEvent e)
      switch(e.getKeyCode())
        case KeyEvent.VK_LEFT:
        currentAngle--;
        repaint();
        break;
        case KeyEvent.VK_RIGHT:
        currentAngle++;
        repaint();
        break;
        case KeyEvent.VK_UP:
        carspeed++;
        hspeed=((double)carspeed)*Math.cos(currentAngle);
        vspeed=((double)carspeed)*Math.sin(currentAngle);
        x = x - (int) hspeed;
        y = y - (int) vspeed;
        repaint();
        break;
        case KeyEvent.VK_DOWN:
        carspeed--;
        hspeed=((double)carspeed)*Math.cos(currentAngle);
        vspeed=((double)carspeed)*Math.sin(currentAngle);
        x = x + (int)hspeed;
        y = y + (int)vspeed;
        repaint();
        break;
    public static void main(String[]args)
    RaceGame race=new RaceGame();
    race.CreateBase();
    //race.setDoubleBuffered(true);
    }and there is no compile time error in this code
    the only error that occurs when u write java RaceGame is because of the car image which compiler doesnt found and throughs exception if u place any image in ur bin folder adn name it car.jpg it wont generate error

Maybe you are looking for

  • Bridge CS4 not recognizing tiff files

    I downloaded an update for camera raw and installed in manually and after this I couldn't open Photoshop.  I then uninstalled and reinstalled CS4 and now bridge will show thumbnails of tiff files but won't open large.  All I see is a generic icon.  H

  • Read multiple text files

    Hi everyone out there, I would like to know how to read multiple files from same directory, but files hve different name, using java. Any help is appreciate, need asap.. Thnx,

  • Calling program

    Dear Experts,      I have a requirements explained below.     I have writen a Z program with the selection screen,  i need to execute the standard program RIMHIO00 (grid report)from Z Program by passing values to the selection screen of standard prog

  • Sales order with MRP run but no need of sales order stock while PGI

    Dear Gurus, We have scenario in company that we want to run MRP for sales order & generate requirements. But while doing post goods issue for same sales order, sales order stock need not be present. Please tell which planning strategy, strategy group

  • Web site error - DNG page

    Does anyone know how to let Adobe know that their web site has an error on it?  The Windows and Mac links are reversed on the DNG download page.  If anyone knows how to tell them, please do so.