Follow an object (mouse click) without decreasing the speed

hello,
i want to make a movie clip follow the mouse while we are pressing the left Button (NOT "be" the mouse ), i end it up with this code but am having a problem,
-the speed of the movie clip decrase by his own, i know that this is happening because of the last two lines, i will be glad if anyone could help me to solve this problem, thanx
onClipEvent (enterFrame) {
          onMouseUp = function ()
                    apui = false;
          onMouseDown = function ()
                    apui = true;
                    rotateSpeed = 3;
          if (apui == true)
                    goX = _root._xmouse;
                    goY = _root._ymouse;
          else if (apui == false)
                    goX = this._x;
                    goY = this._y;
          this._x -= (this._x - this.goX)/20 ;
          this._y -= (this._y - this.goY)/20 ;

thank you, this is solved the speed issue, now i had one last problem, the rotation,
1st let me know if i had to close this discussion and start another one cause i found what i was looking for .
but maybe i can ask about it here,
so here is the rotation issue,
first here is my rotation code
function rotateTowards(clip, targetX, targetY)
          var clipPoint = {x:clip._x, y:clip._y};
          clip._parent.localToGlobal(clipPoint);
          var deltaX = targetX - clipPoint.x;
          var deltaY = targetY - clipPoint.y;
          var rotationRadian = Math.atan2(deltaY, deltaX);
          var rotationAngle = radiansToDegrees(rotationRadian);
          clip._rotation -= (clip._rotation-rotationAngle)/8;
function radiansToDegrees(radians)
          return (radians / Math.PI) * 180;
and i have this code on my car movieClip
onClipEvent (load) {
          rotateSpeed = 3;
onClipEvent (enterFrame) {
          onMouseUp = function ()
                    apui = false;
          onMouseDown = function ()
                    apui = true;
                    rotateSpeed = 3;
          if (apui == true)
                    goX = _root._xmouse;
                    goY = _root._ymouse;
                    rotX = _root._xmouse;
                    rotY = _root._ymouse;
                    _root.rotateTowards(this,rotX,rotY);
          else if (apui == false)
                    goX = this._x;
                    goY = this._y;
          _root.destination_mc._x = goX;
          _root.destination_mc._y = goY;
          this._x -= (this._x - this.goX) / 15;
          this._y -= (this._y - this.goY) / 15;
my problem is to make the rotation more "realistic" for example if we choose to go to the opposit direction i need the car to rollback then make a 1/2 turn then go tward the point
thank you

Similar Messages

  • Using Firefox 3.6 after a few mouse click/ keyboard input the firefox window is no more active, mouse click and keyboard input is inactive ; then I click on the taskbar and the keyboard is active again during a few click then it stops again etc.

    Using Firefox 3.6 after a few mouse click/ keyboard input the firefox window is no more active, mouse click and keyboard input is inactive ;
    to solve it I click on the taskbar and the keyboard is active again during a few click then it does not work any more and I click again on the task bar etc.
    after several repetitions, I have to call the task manager alt+del+ctrl, then come back to the firefox window to be able to use keyboard and mouse again

    Attaching the picture for the tab shape I want...

  • Scene Object Mouse Click Cooordinates (xyz)

    Anyone run into and figured out a method for detecting the scene coordinates (xyz) of a mouse click on an object? Very simply I have a two-dimentional plane (ground) and a box (character) that begins at x0,z0 (directly "on" the plane). I'd like to mouse-click on the plane and move the box to that spot based on the scene x,z. After a few days of trying I'm no closer to solving this seemingly straightforward issue. Anyone wanting to do "click to move" for 3D assets rather than keyboard or mouse drag will need this. Having no real documentation or code-view into the API isn't helping. Am I missing something that should be obvious?
    I have to say that I'm a little surprised that there hasn't been any "official' responses to any of our questions. I think the Proscenium team has done a fantastic job so far with this framework. It's simple to setup and get going yet powerful by giving you great depth into the heart of Stage3D without stepping on the framework itself. But, it's not that hard to imagine that there are a lot of us wanting to move into this "new" medium but feel teased by what we've been shown ('code'us-interruptus?). At the moment you either have to know/learn what you need to create your own framework (a big task if you'v enever done it) or use someone elses. In my opinion the existing third-party options are bloated and unwieldy for my purposes. At a time where "everyone" is trying to quickly get their ideas to market with this new tech it's unfortunate we can't get a few simple questions answered. Seriously, if you have a "discussion" and see that any given post has 100 or more views but zero replys, that's not a discussion. You're just talking to yourself.
    My appoligies for turning this into a rant.

    Thanks for the reply pio.
    I tried that angle (pun only slightly intended) and was successful in identifying the object directly “behind” the cursor using scene.pick, even getting that object’s world position. But, if my ground plane is positioned at 0,0,0 I can only get that position directly from the object, which doesn’t do me any good. What I need to know are the coordinates of the point where the cursor bisected the object, relative to its center, from the origin of the camera view. That would tell me the direction and distance I would need to move another object within world space.
    I thought I had come up with a solution but the immediate problem I ran into was the closed nature of the framework. So, after a few days of unproductive grumbling I decided that the only way I was truly going to accomplish what I wanted was to build everything from the ground-up. I still think Proscenium has great potential but I’m done waiting for a RC. For anyone who’s thought about digging into heart of stage3D and building their own framework, but thought it would be incredibly difficult, well, it is. At least it as for me but anyone who would find it easy probably isn’t in this forum. After climbing a steep learning curve (AGAL and I are back on speaking terms) I finally got going and am extremely pleased with what I’ve accomplished. Granted, I did spend a lot of time initially banging my forehead on my desk but I finally “got it”, and with only a slight concussion.
    The resources are out there.

  • X Y Mouse Click Coordinates in the Request Map?

    I have a mapping application that layers several images with a clickable top layer. When I wrap the top image in a command link I don't get the x and y coordinates of the mouse click in the request map. So I've had to use a regular command button with an image property. This works fine but doesn't allow me to use partial page rendering to limit the refresh of particular images in the stack. Can the x,y coordinate of the mouse click be returned with straight ADF?
    (I"ve included the code for retreiving the x and y coordinates under the jspx code)
    <af:panelGroup type="vertical">
    <af:objectImage source="#{backing_collect2.activeSource}"/>
    <af:objectImage source="#{backing_collect2.baseSource}"
    inlineStyle="position:absolute;left:0px;top:0px"
    binding="#{backing_collect2.baseImage}"/>
    <af:objectImage source="#{backing_collect2.allPointSource}"
    inlineStyle="position:absolute;left:0px;top:0px"
    binding="#{backing_collect2.allPointImage}"/>
    <af:objectImage source="#{backing_collect2.userPointSource}"
    inlineStyle="position:absolute;left:0px;top:0px"
    binding="#{backing_collect2.userPointImage}"/>
    <af:objectImage source="#{backing_collect2.activePointSource}"
    inlineStyle="position:absolute;left:0px;top:0px"
    binding="#{backing_collect2.activePointImage}"/>
    This following fails to return x and y in the request Map, imageMapType="server"
    attr on objectImage does not help
    <af:commandLink actionListener="#{backing_collect2.processClick}"
    action="#{backing_collect2.collectAction}"
    inlineStyle="position:absolute;left:0px;top:0px">
    <af:objectImage source="#{backing_collect2.activeSource}"
    inlineStyle="position:absolute;left:0px;top:0px"/>
    </af:commandLink>
    I have to use the following regular command button to get x, y click coordinates in the request map. But using this component makes its impossible to use partial page rendering to limit refreshes of the images above.
    <h:commandButton image="#{backing_collect2.activeSource}"
    binding="#{backing_collect2.activeLayer}"
    actionListener="#{backing_collect2.processClick}"
    action="#{backing_collect2.collectAction}"
    style="position:absolute;left:0px;top:0px"/>
    </af:panelGroup>
    // Code to get x and y from the request map
    visit.setLastClickPoint(visit.getClickPoint());
    FacesContext fc = FacesContext.getCurrentInstance();
    String clientId = actionEvent.getComponent().getClientId(fc);
    java.util.Map requestParams = fc.getExternalContext().getRequestParameterMap();
    String xString =(String) requestParams.get((String)clientId + ".x");
    String yString =(String) requestParams.get((String)clientId + ".y");
    int xMouse = (new Integer(xString)).intValue();
    int yMouse = (new Integer(yString)).intValue();

    Should have added that I'm using EA14

  • How do I globally uncheck the property "mouse click sounds" under the captions section

    I am doing software simulation and it produces a large number of slides. I want to remove the mouse click sounds. Is there another way to do that other than
    select each and every slide and uncheck the "Mouse Click Sound" checkbox?
    Adobe you need to provide that option in preferences!

    So I tried it...here are the screen shot. I do have the updated Captivate 7....So you can see they are selected and I used the timeline to bring up the mouse clicks box.
    I then unchecked the the 'Mouse Click Box'
    I clicked on the slide...and this may be where it goes wrong. I did try to exit by hitting Enter, but that didn't work. I had to click somewhere on the project.
    Here you can see that slide 2 has the "Mouse Click Sound" box still checked.
    Sweet dreams to all ....it can wait until Monday, unless anyone else who is not sleeping wants to chime in

  • How do I transfer a color from one object to another without losing the gradient?

    COLORING AN OBJECT AND SAVING THE GRADIENT
    These are my notes.
    x
    Choose the EYEDROPPER tool.
    x
    Sample the color you want from an object in your image.
    x
    Double-click on the fill icon at the bottom of the tool panel.
    This brings up the COLOR PICKER panel.
    In that panel, you'll find the numeric value of the color you sampled.
    I followed these instructions but when the COLOR PICKER panel came up, it didn't show the color it was suppose to show.  The color I sampled with the eyedropper was a light blue with a gradient.  I had a few different files up with the same image.  One file brought up the color orange in the Color Picker panel.  And another file brought up a total BLACK, with a numeric value of 0000!  Can anyone tell me what's happening? 

    My guess is the eyedropper tool is struggling.  The best way and the one I use is to get color readings in Photoshop using its eyedropper tool.  Write down the color percentages for each color you want from the image.  Then, in Illustrator, I use the color palette to create new swatches using the percentage I wrote down from the actual image file.  Those new swatches can be used ( or transferred to ) in the gradient palette.  I have never used the eyedropper tool for getting color from anywhere in Illustrator.  But, that's just me.

  • Can't get itunes.  I get the following message when I click on either the shortcut or the program.  It says ITunes has stopped working and I can either check on line for a solution and close the program or just close the program.

    When I click on the itunes shortcut or the program  I get the following message:
    ITunes has stopped working.  My two options are:  Windows can check on line for a solution to the problem or close the program. 
    It seems that my entire library is not there.  If I sync my ipod will it add it back into my library on the computer? 
    I've even tried installing again and nothing works.  Tried the "repair" and it says that ITunes is loaded but I stil get the above error when I try to open the program.
    Thanks

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

  • I am getting the following reading when I click on Firefox: "The application or DLLc:/programfiles/mozillafirefox/xul.dll is not a valid windows image

    I am getting the following pop up reading when I click on the Mozilla Firefox icon located on my desktop: "The application or DLL c:/program files/mozillafirefox/xul.dll is not a valid windows image" I have always used mozilla and now I have no connection to the internet with it. I have tried to go to Mozilla.com to download again and I can't seem to locate a version to download.

    michaeleen, you can fix this with a clean install of Firefox:
    1. Download the Firefox installer from [http://www.mozilla.com/products/download.html?product=firefox-3.6.7&os=win&lang=en-US this direct link] and save it to your desktop or other location.
    2. Make sure that Firefox is closed completely
    3. Delete the Firefox installation directory (On Windows, this is typically the C:\Program Files\Mozilla Firefox folder that contains "firefox.exe" and other Firefox program files and folders).
    4. Reinstall Firefox by running the installer you downloaded previously.
    Your personal settings, including bookmarks and history, will not be lost.
    See http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • How to prevent middle mouse click to move the cursor but still poaste the clipboard ?

    This is a linux only issue.
    When i'm typing a text editing box, i use the select text/middle click gesture to copy/paste text.
    But the middle click not only paste the selected text but move the cursor at the actual mouse position before.
    I don't want this behavior, because :
    1. I work a lot with vim, where you don't mouve the cursor using the mouse, so i must change my habit when i'm using firefox.
    2. When i middle click, event if i put the mouse in the right place, i might mouve it a bit and the text will be pasted on the wrong place
    I've been looking in the about:config and the only related option is
    middlemouse.paste;
    If i put it to false, the middle click button does not mouve the cursor, nor does it paste.
    Any idea how to achieve that ?

    I do not find the cursor moving on me if I use middle-click to paste text or url that is in that I highlighted into clipboard. Whether I used my Logitech MX510 or the T-CH!!/T-CL13 trackballs that I use now.
    The right-click and copy selection then right-click and paste to paste contents where Caret is method can be more precise though.
    '''FredMcD''', if you have not used Linux then maybe you should not be replying to questions that are Linux specific. Same with Mac OSX.

  • How can I do a "middle mouse click" without a 3 button mouse???

    #1:  Is there a keyboard command that will perform a middle click?  I have googled and googled and googled and found hardly any info except something about "option + click", which does not work.
    #2:  Is there a way to make the magic mouse perform a middle click?

    If you could explain your need for this, perhaps someone could offer a work-around solution.
    For example, if it is for a game, many games allow the user to change the presets for actions. If this is the case, setting the desired action to use something like Option-click should work; by doing it within the program (the game) it avoids needing to do anything to the OS.

  • Button click without "refresh" the current page. Please help

    Hi everyone:
    Here is my code:
    Code:
    <HTML>
    <HEAD>
    <TITLE>Parallel Port</TITLE>
    </HEAD>
    <BODY>
    <H1 ALIGN="CENTER">On/Off Bit0 of server's parallel port</H1>
    <form name="myform" action="robotcontrol.jsp" method="POST">
    <input type="hidden" name="action" value="<%=action%>">
    <INPUT TYPE="SUBMIT" VALUE="set/reset">
    <jsp:include page="./VideoToApplet/htmlroot/index.html" flush="true" />
    </form>
    </BODY>
    </HTML>
    everytime i click the button, it will perform (set/reset) parallel port, and i have include a html page which consist a video streaming applet.Maybe cause of this:
    <form name="myform" action="robotcontrol.jsp" method="POST">
    So.. please help !! Thanks in advance.
    but unfortunately, everytime i click on the button, it will likely refresh the page, and the applet will auto reconnect to camera,(it take time to reconnect)..

    Inside the body of JSP/HTML page, at the end of <BODY>, paste this small script.It will refresh your page automatically after 20 seconds, that is nothing but the value assigned to V.You can assign the time interval as you wish.
    <SCRIPT language="javascript">
         var ONESEC = 1000 ;                    // One second (in ms)
         var V = 20 * ONESEC ;
         var ONEMIN = 60 * ONESEC ;     // One minute (in ms)
         var INTERVAL = 1 * ONEMIN ;               // How often is page refreshed (in ms)
         window.setTimeout(function(){
                                            window.location.reload() ;
                                            },V) ;
    </SCRIPT>

  • Pop-up box upon mouse click without separate URL

    Hi there,
    I'm not sure what to call this, so I have referred to it as a "pop-up box upon click" for lack of a better description. I am an amateur and have taught myself how to make this site.
    Hi there, here is what I am trying to do...There is a page on my website that display details about our shows. Instead of having all info displayed all the way down the page, I want it to be tucked away neatly, so the viewer can click it for more details. All they would see initially is just the date and location. I have tried the Adobe spry collapsible panel but I'm not a fan of it and it keeps breaking when I try to update it.
    How I want it to look and behave is like the Photos page on my website. I want to click whichever show I am interested in reading more about, and have a neat and clean little box pop up with the details and an 'X' to close it (exactly looking and behaving like when I click a picture thumbnail to enlarge it). It would be nice if the content inside the box was selectable for the viewer as well so they can copy and paste the info. I don't want to have to create and link to new page for evey single show we book.
    Please let me know a code I can implement to do this, how to edit the content inside the new box, and where to put it on my page's code.
    Website I'm wanting this on: www.dieseljunkies.ca > Shows
    Software I am using: Adobe Dreamweaver CS3
    Thanks!
    J

    Just went and dl'ed the adobe widget browser and found something under lightbox called clearbox which can display web content. I added it to "My Widgets". It tells me to import it into dreamweaver, to go to Insert>My Widgets and select the widget. Only problem there is no Insert>Widgets in Dreamweaver CS3 for PC. I am quite lost now. I tried to configure it and all that but no clue where it is saving to or how to go about this. I am wondering what an easy step by step would be for this eg:
    1 Open Dreamweaver
    2 insert a clearbox link on your page by Doing "this"
    3 Insert "this" code "here"
    4 host "this" file on your website's ftp
    5 edit "this" part of the code for content and "this" part for the header
    Jason McFarland, Marketing & Inside Sales
    KELCOM Mobility Solutions Division
    363 Eugenie St. E., Windsor, ON N8X 2Y2
    Phone: 519-250-9100 ext. 2501 • Mobile: 519-564-9823
    Fax: 519-790-0241
    [email protected] • www.kelcom.com
    DID YOU KNOW?…
    KELCOM sells
    barcode scanners,
    barcode printers
    and labels!

  • Write a program that draws a line from one mouse click spot to the next.

    WHERE AM I GOING WRONG?
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.geom.*;
    public class Week8Lab extends Applet implements MouseListener
         private int[] x;
         private int[] y;
         private int count;
         public void init()
              x = new int[10];
              y = new int[10];
              count = 0;
              this.addMouseListener(this);
         public void paint(Graphics g)
              for(int i = 0; i < 10; i++)
                   g.drawLine(x[0], y[0], x[i]+1, y[i]+1);               
         public void mouseEntered(MouseEvent e) {}
         public void mouseExited(MouseEvent e) {}
         public void mousePressed(MouseEvent e)
              x[count % 10] = e.getX();
              y[count % 10] = e.getY();     
              count++;
              repaint();
    System.out.println ("Mouse X =" + e.getX() + "Mouse Y =" + e.getY());
         public void mouseReleased(MouseEvent e) {}
         public void mouseClicked(MouseEvent e) {}
    WHERE AM I GOING WRONG?

    Try this:
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class Week8Lab extends JFrame implements MouseListener {
         private int lastX = -1;
         private int lastY = -1;     
         private int newX = 0;
         private int newY = 0;     
         public Week8Lab(){
              this.addMouseListener(this);
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
         public void paint(Graphics g){
              if(lastX < 1){
                   lastX = newX;
                   lastY = newY;
                   return;
              g.drawLine(lastX, lastY, newX, newY);
              lastX = newX;
              lastY = newY;
         public void mouseEntered(MouseEvent e) {}
         public void mouseExited(MouseEvent e) {}
         public void mousePressed(MouseEvent e){
              newX = e.getX();
              newY = e.getY();
              repaint();
         public void mouseReleased(MouseEvent e) {}
         public void mouseClicked(MouseEvent e) {}
         public static void main(String[] args){
              JFrame fr = new Week8Lab();
              fr.setSize(300, 300);
              fr.setVisible(true);
    }

  • At runtime, can it be determined if multiple overlapping objects/layers exist beneath a mouse click?

    Hi folks - total nube here. I am trying to find out whether I can determine if multiple objects exist beneath a usr's mouse click coordinates. The objects will be either shaded areas under a LineSeries in a chart or possibly overlayed images representing such areas (not sure which approach would be better). I know that I can probably determine alebraically whether the coordinates selected b a mouse click belong under one series or another or multiple and if this is the best option, then I will proceed with it. But possibly, there is a way for me to determine whether a shaded area under a series or a grpahical element exists under those coordinates. Any hints? Thanks in advance.

    Yes, export it for your reference first. make it delete and create new one.
    hope it should work fine.
    thx
    Deep

  • Control mouse pointer without the mouse

    Hello,
    My Mac Mini seems to no longer recognize my mouse. It has been fine for nearly a year though. Both the mouse and keyboard are wireless. The pointer does not move when I move the mouse, but when I press the return button on the keyboard the computer does wake from sleep mode. I don't know how to control the pointer without the mouse though.
    The issues seem to have started when my new version of iTunes seemed to start acting up. The bar at the top of the screen shows that it thinks it is still in iTunes. The computer has been manually turned off and restarted and still comes up the same way, with the mouse pointer in the same spot.
    Does anybody know what the issue may be and also how I can control the pointer without the mouse? I apologize for the lack of knowledge as I'm used to a pc and do not know the keyboard controls on a Mac. Thank you.

    Welcome to the Apple Discussions!
    You should always have an inexpensive USB mouse and keyboard for times such as this. After you have gotten a USB mouse, you can get one at Target for US$10, drag & drop the iTunes app into the Trash. Restart your Mac and while you are at it do a PRAM reset. Then download iTunes from this link and reinstall. Hopefully this will resolve your issues.
    http://www.apple.com/itunes/download/
    Reset the PRAM
    • (Re)start the computer
    • Immediately press & hold the CommandOption+PR keys
    • Wait for two startup chimes
    • Release the keys and allow the computer to boot.
    Also, do you ever repair the disk permissions on your Mac? To repair the disk permissions open Disk Utility in the Apps/Utilities folder. Highlight your startup drive in the list on the left with one mouse click. In the right pane press Repair Permissions. Wait for it to finish.
    Dah•veed

Maybe you are looking for