I need help moving two objects at the same time

I am try to create a code that will move a mini map to where the user wants in a game. As a test I created a square and converted it to a movie and named it sq. Then I created another square and converted it to a button and named it bt. I also made bt half the size of sq and placed bt at the center of sq. I then created a drag code which like this:
sq.addEventListener(MouseEvent.MOUSE_DOWN, startDragging); // Start dragging square by user
sq.addEventListener(MouseEvent.MOUSE_UP, stopDragging); // Stop dragging square by user
function stopDragging(evt:MouseEvent):void
sq.stopDrag();
bt.x=sq.x;
bt.y=sq.y;
// this moved bt to sq(x,y) when mousebutton was released
function startDragging(evt:MouseEvent):void
sq.startDrag();
bt.x=sq.x;
bt.y=sq.y;
// this moved bt to sq(x,y) when mouse button was pushed down
I am trying to get sq and bt to move smootly together, but as it stands right now it just jumps from place to place.
I have tried looking for some kind of linking code in abode help search, however, I am not sure want to look for exactlly

The mouseDown and mouseUp events are single action events, so the button will only change positions on either the mouseDown or the mouseUp events. If you add a mouseMove event listener, then you can change the location of the button every time the square moves. Alternately, you could use an enterframe event to change the location of the button relative to the square. Try this code:
sq.addEventListener(MouseEvent.MOUSE_DOWN, startDragging); // Start dragging square by user
sq.addEventListener(MouseEvent.MOUSE_UP, stopDragging); // Stop dragging square by user
sq.addEventListener(MouseEvent.MOUSE_MOVE,dragButton);
function stopDragging(evt:MouseEvent):void
sq.stopDrag();
function startDragging(evt:MouseEvent):void
sq.startDrag();
function dragButton(evt:MouseEvent):void {
          bt.x = sq.x;
          bt.y = sq.y;

Similar Messages

  • Need help recording three shows at the same time

    I have the FiOS DVR, and have a problem this TV season.  There are 3 shows that we watch that are on at the same time.  if we are home that night, we can record two on the DVR and watch the other in another room.  Not ideal, but we can handle it.  But if we are out, we are hosed.  I have an old series 1 Tivo that I would think I could factor in here....which I could timer record on a different TV.  Any way to do it on my regular TV?  Not sure how I could hook up the Tivo with the DVR and the rest of it.
    Thanks!
    Alan

    DocAlan02 wrote:
    I have the FiOS DVR, and have a problem this TV season.  There are 3 shows that we watch that are on at the same time.  if we are home that night, we can record two on the DVR and watch the other in another room.  Not ideal, but we can handle it.  But if we are out, we are hosed.  I have an old series 1 Tivo that I would think I could factor in here....which I could timer record on a different TV.  Any way to do it on my regular TV?  Not sure how I could hook up the Tivo with the DVR and the rest of it.
    Thanks!
    Alan
    I have a similar setup with a Replay.
    You will need to get a Verizon Digital Adapter for $3.99 per Month and an IR Blaster for your Tivo.
    Connect the Digital Adapter (DCT-700) to the FIOS Coax (May need to use a Splitter).  Connect the Composite Out cables from the DCT-700 to the Tivo.  Connect the IR Blaster from the Tivo to the front of the DCT-700.  Configure the Tivo and tell it you have FIOS Cable and Digital Adapter.  You may need to find the right codes to use to control the FIOS box from the Tivo.
    Once you get it configured you will be able to tell the Tivo to record the 3rd program and it will switch the box to the channel and record it.  If the box is near your other Verizon STBs you will need to hide it or cover the IR Sensor so that the remote for the main STB does not control the Digital Adapter.
    As an added bonus you can connect the Coax Out from the DCT-700 to your Main TV if it has PIP and now you have a 2nd input source to make PIP work.
    If you are the original poster (OP) and your issue is solved, please remember to click the "Solution?" button so that others can more easily find it.
    If anyone has been helpful to you, please show your appreciation by clicking the "Kudos" button.

  • Need to Open Two Windows at the same time

    Hi All ,
    I have a requirement wherein I am opening a new page when the user presses a link . The information displayed to the user in the new page is Read-Only.To display the reqd info on the new page I pass some parameters encoded in the page call URL.
    Besides , displaying the info in the new page , it is imperative that i allow the user to continue performing some transactions in the current page (calling page).
    However , i am not able to achieve the same . If I use 'retainAM=Y' in the URL then i pass the Session Control from the calling page to the called page . So that option is out.
    Can u suggest something wherein i am able to pop-up a new page to the user , but still not loose the session control from the current page.
    It is necessary that the user has both windows open to perform the transactions.
    Thanks
    Chirag

    Senthil
    I need to clarify some things . I cannot create an OA Function as you have earlier advised . Lets say its a constraint i have. My scenario is that i have to prepare a HyperLink Declaratively . In that i am currently giving _Blank as the target .
    Now i want to open the new page and still allow the user to perform some transactions in the original page while the new page is still open . How should i go abt maintaining my AM from original page.
    Following are the scenarios i have already tried out.
    1) I have opened the the new page and released my application module in that page . This didnt work .
    2) I have tried doing retainAM=N . This also does not work.
    3) Using PopUp is not an option since i cant create OAFunction .
    Are their any other way . When i open a new window thru a current window , my AM gets transferred to the new window . Hence i am not able to perform any transactions on that the original page . How can u release the AM On click of a link ?
    Pls Suggest
    Thanks
    Chirag

  • Need to sort two vectors at the same time! please help!

    I have
    vectorA: 2 4 9 1 7 6 8
    vectorB: two four nine one seven six eight
    i want to sort these two vectors in parallel
    what is the best way?
    i could just do Collection.sort(vectorA) and get
    1 2 4 6 7 8 9
    but i want the vectorB to have a corresponding order
    please help!!
    thanks

    public class Pair implements Comparable {
    private int value;
    private String name;
    public int getValue() {
    return this.value;
    public void setValue(int value) {
    this.value = value;
    public String getName() {
    return this.name;
    public void setName(String name) {
    this.name = name;
    public int compareTo(Object o) {
    Pair that = (Pair) o;
    return this.value - that.value;
    place both in a Collection (vector is a bad choice if you are going to do sorting LinkedList is better) the Collections.sort method will sort
    according to the compareTo method.

  • Drag two items at the same time

    I need to drag two items at the same time using the jqueryUI draggable widget; as in I'll drag one of the items, and the other one should stick to it.
    Is this possible ?

    Thanks for your reply. I fond a way to do this although this is not copy/paste.
    1. Open "iMovie Projects" folder and find the project that contains voiceover file
    2. Right click and select "Show Package Contents"
    3. Drag and drop "Voiceover Recording.aiff" file to a project I want to copy/paste
    In this way you don't need to use iTunes or other software to move around audio files.

  • How can I open two libraries at the same time on itunes?

    Hey i need help on opening two libraries at the same time on itunes. I don't know if that is possible but need some advice if its possible. I already have several libaries but I need to compare labaries at times due to various users on my computer. Please help .

    Not that I'm aware of. What exactly is that you want to achieve? There are tools for scanning media folders and adding any files not listed in the library, or deleting those that no longer exist. There are also ways to use one library for multiple users so that any tag update gets applied for everyone.
    tt2

  • How to make this two things at the same time ?

    Hello
    When my mouse is on a area, I need :
        -  to show a object (a rectangle inserted with the toolbar)
        -  to show a caption
    I think it's not possible to do this two things at the same time when I use the rollover functions (Rollover caption or Rollover Image).
    I would like to use a button, but the button works only if I click it, and not when I just pass my mouse on it.
    Someone have an Idea?
    I can't use Javascript.
    Thanks

    Rick is correct.  You can use the Rollover Slidelet's rollover area to trigger an Advanced Action.  You'll need to create this Advanced Action with two clauses.  One to SHOW the caption, and the other to SHOW the rectangle.
    Your alternative to the rollover slidelet is to use an Event Handler widget attached to the object that the mouse should roll over.
    The Event Handler will detect when the mouse is over the object and trigger its own Success criteria.  You can then use the widget's ON Success event to trigger the Advanced Action as mentioned above.
    More information about using the Event Handler here: http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets
    An example of using it to do two different things on the same object can be found at this web page: http://www.infosemantics.com.au/adobe-captivate-advanced-elearning-tutorials/beat-adobe-ca ptivate-interactive-catch22
    Trial versions of the widget can be downloaded from here:  http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets

  • Track several object at the same time

    Hi everybody,
    I`m actually trying to tracking several same objects at the same time.
    I knew how to do with only one object, and I was able to send the coordinate for each frame in excel. So great.
    But now I`m trying to modifiy the code to follow eight objects at the same time.....
    My code was already HUGE with one or two objects, but I need to add again 6 part of the same code....
    I would like to compact and contract my code to be more clear.....
    I suppose there is one solution juste after Labview vision assistant. And i`m sure that there is a way to put all the code to delete the zeros in only one for loop but I didn`nt find the right way....
    Anyway if there are some propositions or some ideas, advices..... it`s welcoming
    Thks a lot
    Sincerely
    Maxime 
    ps: I put my codewith only two patterns
    Attachments:
    Simple tracking.vi ‏146 KB

    Yeah -- you have 4 separate tracks with the same audio? Select all 4 tracks/clips in your Event and select Synchronize Clips. You end up with a compound clip in the event with all 4 clips synchronized to the audio. Open the compound clip in a Timeline and select all 4 clips. Use  Video > Transform and type in ~48% (if you want the "gutters") to resize all the clips at once. With the transform icon (lower left corner of the canvas) selected, drag each of your clips out to the four corners (or type in exact position values in Video > Transform > Position parameters.) To get the white background, you can use Generators > Elements > Shapes - set the color to whatever you like; select Rectangle from the drop down and Video > Transform > Scale to expand it to full screen. Drag the generator underneath your storyline to use as a background.
    If you don't have audio to synch to, you can create multiple storylines. Add the first clip; reset the playhead and select your other clips that will appear in a 4-up and type Q to *connect* them to the storyline. Then select each one separately and right click > Create Storyline (or type command - G). You can then open each storyline in its own timeline (right click and select Open in Timeline) and append more clips to each "track". Back in the main storyline, drag out each connected storyline to reveal any appended material. The trim control will turn red when you reach the end of media in the created storylines. Resize and arrange as described above.

  • Generat two signals at the same time and reading voltage

    Hii
    i have try to generate two signals at the same time and read voltage from another port on the board(not have to be at the same time), i have not alot of expriens in labview
    and i based my code of example(http://zone.ni.com/devzone/cda/epd/p/id/5197) from yours site and try to suit to my needs
    now my problem is when i generat the 2 signals(that work perfect) i canot read voltage from another port on my CB-68LP
    i can not find the problem  and make it over i hope there is away to figer out and fix it.
    i have two cards 6229, and two CB-68LP board.
    labview 8.5.
    my code is look like this - http://img142.imageshack.us/my.php?image=scrennshot2no2.png
    (this works perfect).
    and this is my code after suit to my need - http://img183.imageshack.us/my.php?image=scrennshotfl5.png,there is  error exception at  the right side.
    the exception-
    Possible reason(s):
    Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
    Property: RefClk.Src
    Source Device: Dev1
    Source Terminal: 10MHzRefClock
    Required Resources in Use by
    Task Name: _unnamedTask<0>
    Source Device: Dev1
    Source Terminal: None
    Destination Device: Dev1
    Destination Terminal: RefClock
    Task Name: _unnamedTask<1>
    eyal

    sorry...
    The AO tasks is very important they will be synchronize ,it is very importent the two tasks will start at the same time
    and after it run at synchronize mode i will need to make reading of voltage
    i gust try to make simulation of machin (i give that machin AO and reading from it voltage that all)
    first of all i make the two signals(synchronize signals).
    and after it i will need to reading voltage.
    i can make two signals synchronize together.
    i can make reading voltage
    but i can't make two signals synchronize together with reading voltage
    it throw to me this error message.
    i am looking for away to figer this out.
    thank's for any help 
    eyal
    Attachments:
    test11.vi ‏130 KB

  • Write a progarm to test two parts at the same time

    Hi:
    I need to write a program in LabView that is capable of testing two parts at the same time.
    Explanation:
    I star the test on a unit, once all the electrical test is done move that unit to the pressure test without loosing the current test information and continue the test of the unit thewn generate a serial number only if it passes all the test. Then while the previous unit is going thru the pressure test star testing another unit for the elecrical test and so on.
    I am using LabView 2012

    From what you have described, I agree with what has been answered above. TestStand is specifically designed for. If you would like to provide more information about your application we could give you a more detailed response. For more information about TestStand follow this link
    www.ni.com/teststand
    Ryan
    Ryan
    Applications Engineer
    National Instruments

  • One again, "can I use CC on two computers at the same time?" - in practice.

    I know this has been asked before and all those threads are locked. Many asked the question, but I haven't found a satisfying answer yet.
    Can I multi task with CC?
    I want to have my laptop next to my desktop. And while I render, export or whatever my newly shot documentary on the laptop I want to work with a music video project on my desktop. Then when the render is finished I render the music video and go back to the laptop and continue on the documentary. Or maybe I just work 5 minutes on the desktop music video, then come up with something brilliant for the project on the laptop and switch. Back and forth. Will that kind of activity result in any kind of limitation, usage-wise?
    So, working on Premiere on my two computers at the same time.. is it possible? Technically? I know the EULA says "only one person". But will it let one person mutli task?
    I need to know this before I buy. sorry for asking this again, please bless me with a clear answer

    Hi Jimmy Crim,
    Yes in case of Creative cloud subscription you are allowed to install and use the cc apps in any two machines.
    Even if you want you care allowed to use these apps together in both the machines.
    Thanks
    Kapil

  • Can I access two websites at the same time?

    Does Dreamweaver have the ability to open two websites at the same time?
    I basically have a CMS hosted on one server, that connects to my clients sites on other servers. I want to be able to open files on one server and edit them and also edit files on another server at the same time.
    If this isn't available in Dreamweaver, then I think it should be. I often need to copy code from one page in a site to another page in different site. To have the ability to have two windows open, each connected to a different website server would be invaluable to me. By having separate windows, each can have its own server connection. I don't know how easy that would be, but I'd love it!
    Cheers
    Glynn

    You can only connect to one site at a time.  And you need to edit files locally, save & then upload to the remote server.   AFAIK, no single FTP app is capable of connecting to more than one server at a time.  You might be able to do what you want with DW open and an additional 3rd party FTP client like Filezilla, each connecting to different servers.
    Nancy O.

  • Re: if weblogic can serve two ports at the same time?

    That's not true. WebLogic supports a non-secure and secure listener port at the
    same time. That was one of the selling points for my organization.
    Michael Girdley wrote:
    If, you mean the same port on two different IP addresses, then the answer is
    yes.
    If, you mean two different ports on the same IP address, then the answer is
    no.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    fxy <[email protected]> wrote in message
    news:8fdk99$t9$[email protected]..
    <URGENT QUESTION>
    I'd like to know if weblogic can support two ports at the same time.
    thank you in advance.
    <URGENT QUESTION>

    Well, the question was really meant to see if any change was made to WL to support
    this, not because I didn't believe Michael Girdley.
    P.S., this is something Websphere 4.0 let's you do...In case this encourages someone
    to add this support.
    "Mike Reiche" <[email protected]> wrote:
    >
    If you don't believe Michael Girdley, then I don't know why you would
    believe anyone
    else. I believe the answer is still 'no'.
    Why do they 'have to be on different ports'? We block requests by URI
    - so just
    block all requests to /youradminapp/* at the firewall. Or you can block
    them at
    your Web Server. Or restrict them by user in WL.
    Mike
    you"Anil Arora" <[email protected]> wrote:
    Is it still true that WL 6.0 cannot host multiple (non-secure) HTTPports
    on one
    server? We need this capability within one JVM to allow one web application
    to
    be accessed from one port while another through a second port. Forexample,
    we
    have a application to be exposed through the firewall at port 7001.
    Then we have
    another admin application to only be accessed within the firewall. But
    they need
    to be deployed within the same JVM since they may have shared statebetween
    them.
    Thanks,
    Anil
    "Michael Girdley" <[email protected]> wrote:
    I'm sorry, to clarify my statement: I was speaking about nonsecure
    communications. Weblogic can only support one listener port at a time.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    Allen Akers <[email protected]> wrote in message
    news:[email protected]...
    That's not true. WebLogic supports a non-secure and secure listenerport
    at the
    same time. That was one of the selling points for my organization.
    Michael Girdley wrote:
    If, you mean the same port on two different IP addresses, then
    the
    answer is
    yes.
    If, you mean two different ports on the same IP address, then theanswer
    is
    no.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    fxy <[email protected]> wrote in message
    news:[email protected]...
    <URGENT QUESTION>
    I'd like to know if weblogic can support two ports at the same
    time.
    thank you in advance.
    <URGENT QUESTION>

  • HT2736 Can I gift a song to two people at the same time so I only have to go through the process once?

    As the subject says can I gift a song to two people at the same time so I only have to go through the process once? For example can I enter two seperate email addresses in the "To" line seperated by a semicolon like I can in Outlook?
    Thanks for the help

    Is there any way I can be on both of these networks at the same time or is there some other way I can configure this?
    Yes, you can reconfigure the Time Capsule (TC) to "Join a wireless network." In this case the wireless network would be the one created by the other wireless Internet router. In this configuration, the TC can still share its internal (and external) hard drive and a printer attached to the USB port. However, note that this would disable the TC as a router and an Ethernet switch so basically it will perform as a wireless client.

  • Two images at the same time

    Hi!
    I'm new into FCE and I would like to ask for some help. Can I work with two images at the same time? I mean, Can I superimpose two images to make one? How can I do it?
    Maybe this is something easy, but I'm just starting,
    thanks in advance for your answers
    Message was edited by: angelcotallo

    Yes, you can. You can put one clip on top of the other in the timeline. You can make both clips visible by reducing the opposite of the clip or top, or by scaling back the clips so they are smaller. You can reduce the opacity and scale of the clips in the viewer by opening the clips from the timeline into the viewer. You can also scale the images directly in the canvas when it is in Image+Wireframe mode.

Maybe you are looking for

  • Error when installing CS4

    When installing photoshop CS4 for the first time i get an error, I start the setup then i select to install Photoshop with adobe bridge and when i click install the process begins and when it's almost about to finish i get the following error: Instal

  • Report based on two facts and dimensions

    Hello All, I have a report that comes from two facts say F1 and F2. There are certain conformed dimensions, and certain non conformed dimensions. Now say Product is a conformed dimension. Now these fact tables are at a very detail level and have mill

  • Moving itunes source

    i have my music and video library on a external hard drive and every time that i unplug it to move my laptop. itunes re-maps my source folder to the default c drive one which has nothing in it. the next time i open itunes it tells me that it cannot f

  • Automatic invoice before PGI

    HI experts, im facing issue that     invoice happening automatically  for gift vocher ( service item having delivery) immidiatly after delivery before PGI. we r fallowing auto delivery, we are in is-retailing plz give me solution to the same, advance

  • Using home sharing, can I view (stream) TS folders?

    Using home sharing, can I view (stream) TS folders as I would with DVD Player? Must they be be converted to smaller H264 first (don't want to...too many, takes too long)?  Does it place more demand to stream TS folders on the WiFi that iTV is hooked