How do I change position when the mouse is clicked?

So, I'm doing a firearm are intended to the cross, so that it follows the mouse all the time. I want that it back down, then the mouse pointer goes up and the gun keeps track.

I tried something like mouseY - 10; but with no luck, it did nothing. Thank you.

You can't control the mouse of the users.  You can "hide" the users mouse and use a clip shaped cross to indicate where the mouse is and that movieclip, you can control.

Tags: Adobe Animate

Similar Questions

  • How to make text disappear when the mouse is over a button?

    Hello, I'm completely new to Flash, and well I need help. I created a page that contains static text in the Center.

    Page has buttons on the side and when I rollover a button text is displayed, but the problem is that when I rollover a button, static text in the Center is here and I want to hide as I can't read anything either because the texts are overlapping.

    How can I make the text in the centre disappear / hide when I rollover a button and how do I make it reappear when the mouse is the off button?

    I hope what I said makes sense.

    You can assign the code onRollOver and onRollOut buttons to the dispappear of text, but you will need make the text a movieclip with instance name that you can use to target to make it invisible.  In the example below, the button has an instance name of "btn" and the movieclip of text has an instance name of "text_mc".

    btn.onRollOver = function() {}

    text_mc._visible = false;

    }

    btn.onRollOut = function() {}

    text_mc._visible = true;

    }

  • How to add multiple lines when the button is clicked

    How to add multiple lines when the click on button now is just add a row .plz give me idea how... waiting for answer

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    ObjectChoiceField obj1 obj2, obj3, obj4.
    Table of String() = {'101 ', ' 102'};
    String of shadow [] = {"Shade1", "Shade2"};
    Rolls of string [] = {'101 ', ' 102'};
    String cutting [] = {"100-150", "150-200"};
    Chain of selectedindex1, selectedindex2, selectedindex3, selectedindex4;
    LabelField lbl1 lbl2, lbl3, lbl4;
        
    GFM LinedGridFieldManager;
    HFM HorizontalFieldManager, hfm1, hfm2 hfm3;
    VerticalFieldManager vfmMain;
        
    public MyScreen()
    {
        
    Set the displayed title of the screen
    hfm1 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm2 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm3 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    HFM = new HorizontalFieldManager (HorizontalFieldManager.FIELD_RIGHT);
    vfmMain = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
            
    obj1 = new ObjectChoiceField ("", graph, 0, FIELD_LEFT);
    obj2 = new ObjectChoiceField ("", blind, 0, FIELD_LEFT);
    Obj3 = new ObjectChoiceField ("", rolls, 0, FIELD_LEFT);
    Obj4 = new ObjectChoiceField ("", cuts, 0, FIELD_LEFT);
            
    LBL1 = new LabelField("");
    LBL2 = new LabelField("");
    lbl3 = new LabelField("");
    lbl4 = new LabelField("");
            
    ButtonField btnAdd = new ButtonField ("ADD", FIELD_RIGHT);
            
    GFM = new LinedGridFieldManager (4, LinedGridFieldManager.VERTICAL_SCROLL);
            
    hfm1.setMargin (20, 0, 10, 0);
    hfm1. Add (new LabelField ("Chart"));
    hfm1. Add (obj1);
    hfm1. Add (new LabelField ("Shade"));
    hfm1. Add (obj2);
            
    hfm2. Add (new LabelField ("Rolls"));
    hfm2. Add (Obj3);
    hfm2. Add (new LabelField ("Cuts"));
    hfm2. Add (Obj4);
    HFM. Add (btnAdd);
            
    GFM. Add (new LabelField ("Chart"));
    GFM. Add (new LabelField ("Shade"));
    GFM. Add (new LabelField ("Rolls"));
    GFM. Add (new LabelField ("Cuts"));
            
    vfmMain.add (hfm1);
    vfmMain.add (hfm2);
    vfmMain.add (hfm3);
    vfmMain.add (hfm);
    vfmMain.add (new SeparatorField());
    vfmMain.add (gfm);
    Add (vfmMain);
            
    btnAdd.setChangeListener (new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];
                    
    While (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }
    }
    });
    }
    }

    Hi Piya,

    I run your code, and according to your logic that it works correctly.

    It's adding that line only once because according to your logic that one line can be added to MDT, if you do not want to add line on each click on the button, follow these steps:

    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];

    Lbl1 LabelField = new LabelField("");
    Lbl2 LabelField = new LabelField("");
    LabelField lbl3 = new LabelField("");
    LabelField lbl4 = new LabelField("");
    If (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }

  • How do I enlarge the image when the mouse is clicked

    I want to enlarge the image when the user clicks on the image. How to make muse? Thank you!!!

    I think you are trying to implement something like 'Click to see in original size' for images in a slide show widget. If that's what you try to achieve, refer to a similar thread here a possible solution: http://forums.adobe.com/message/5225256#5225256

    Thank you

    Vinayak

  • Two problems that seem to be related. The screen turns off suddenly and reappears when the mouse is clicked. At the same time, the cursor insertion point disappears.

    The cursor disappears during the strike. It is blackened and cursor disappeared three times during the typing of this sentence. Very frustrating! I'm running Windows 7 Pro on a Dell Inspiron.

    Hi Ed,

    Thanks for posting your question in the Microsoft community.

    I understand that you have 2 problems on your Windows 7 computer.

    1. The screen turns off when you click with the mouse.
    2. The cursor on the screen disappears while typing.

    Let me know if this interpretation is erroneous. To better understand the issue, let me ask a few questions.

    1. What is the brand and model of the computer?
    2. You did changes to the computer before the show?

    I am here to help you and I suggest these methods to solve the problem.

    Method 1:

    Start the computer in safe mode and check if the same problems occur. Safe mode allows only a minimum set of services to load, this will help us to know if a service is causing the problem.

    Startup options (including safe mode)
    http://Windows.Microsoft.com/en-us/Windows7/advanced-startup-options-including-safe-mode

    Method 2:

    If the problem does not occur in safe mode, and then perform a clean boot, this will turn off non-Microsoft services and therefore to determine if any non-Microsoft service is causing a conflict for the problem to occur.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: once the diagnosis is made, follow the steps in the article to configure the computer to start the Normal start.

    Method 3:

    The question could have occurred because the drivers on your computers are not updated. See the link, follow the steps and update the drivers.

    Update drivers: recommended links

    http://Windows.Microsoft.com/en-us/Windows7/update-drivers-recommended-links

    You can also check this link for more information.

    Updated a hardware driver that is not working properly

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    View the status of the issue. If the problem persists then let know us, we will provide several methods.

  • Re: How make a Word appear when the mouse click on an object I created.

    I am a beginner again, the software I have is fl Adobe CS4.  I succussfully has created a scene with all the correct layers including a start button action script.  No error does not work very well. Now, my next challenge is, how to cause a Word to apear?  I created a few items that I would like to select and cause a Word to appear and color to change, once I have fly over the object.  It's like the same method when you create a "Start button".  Can I create another sub scene in the action script command?

    You should not ignore the error (and also you can not). However, the code that you pasted contains no problematic piece of code that generates the error.

    To locate the error line, select allow debugging in publication settings.

  • Taskbar displays the differences between maximized windows and language bar changes positions when the taskbar is moved

    original title: problem moving taskbar

    Hello

    When I move the taskbar to another job, not only is the language bar moves next to the Start button, but also, there seems to be a gap between the taskbar and maximized window (firefox, etc.)

    Help.

    Thank you.

    Hello


    I would suggest trying the following methods and check if it helps.
    Method 1:
    Run the scan of auditor of file system (CFS) and check if it helps.
    How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista: http://support.Microsoft.com/kb/929833
     
    Method 2:
    Try to create a new user account and check if it helps.
    Create a new user account: http://windows.microsoft.com/en-US/windows-vista/Create-a-user-account
    Note: If the new user account works, see steps on how to copy files to the new user profile in Microsoft article provided: http://windows.microsoft.com/en-US/windows-vista/fix-a-corrupted-user-profile
     
    Hope the information is useful.
  • How to raise an event when the user have clicked all the buttons (in random order)?

    Greetings,

    I want to trigger an event (frame 2 goto and stop) after all my 3 user buttons were clicked in no particular order.

    I have 3 buttons on the stage, image1. (instence names: MCBlue, MCRed, MCYellow)

    How can I write my code?

    Here's what I have, but it does not at all. I'm so confused.

    I thank very you much for your time.

    [code]:

    import flash.events.Event;
    import flash.events.MouseEvent; 
    
    stop();  
    
    MCRed.addEventListener(MouseEvent.CLICK,redReady);
    MCBlue.addEventListener(MouseEvent.CLICK,blueReady);
    MCYellow.addEventListener(MouseEvent.CLICK,yellowReady);
    
    function redReady(event:MouseEvent):void
    {
              MCRed.MouseEvent.CLICK();
    }
    
    function blueReady(event:MouseEvent):void
    {
              MCBlue.MouseEvent.CLICK();
    }
    
    
    function yellowReady(event:MouseEvent):void
    {
              MCBlue.MouseEvent.CLICK();
    }
    
    
    var buttons:Array = [redReady, blueReady, yellowReady];
    var sequence:Array = [];
    var correct:int;
    
    
    addEventListener(Event.ENTER_FRAME, gotoFrame);
    
    
    function gotoFrame(e:MouseEvent):void {
              if (buttons.indexOf(e.target) == sequence[correct]){
                        gotoAndStop(2);
              }
    }
    
    

    If the buttons are movieclip symbols, then a way to solve it would be to set a property of each button to be true, when everyone gets clicked and then have a function that you call who checks this property for all buttons.  When all the true test is when you switch to the 2 structure.  Something like...

    import flash.events.Event;
    import flash.events.MouseEvent;
    
    stop();  
    
    MCRed.addEventListener(MouseEvent.CLICK,redReady);
    MCBlue.addEventListener(MouseEvent.CLICK,blueReady);
    MCYellow.addEventListener(MouseEvent.CLICK,yellowReady);
    
    MCRed.clicked = false;
    MCBlue.clicked = false;
    MCYellow.clicked = false;
    
    function redReady(event:MouseEvent):void
    {
              MCRed.clicked = true;
              gotoFrame();
    
    }
    
    function blueReady(event:MouseEvent):void
    {
              MCBlue.clicked = true;
              gotoFrame();
    }
    
    function yellowReady(event:MouseEvent):void
    {
              MCYellow.clicked = true;
              gotoFrame();
    }
    
    function gotoFrame():void {
              if(MCRed.clicked && MCBlue.clicked && MCYellow.clicked){
                        gotoAndStop(2);
              }
    }
    
  • How to perform an action when the button is clicked reply all in BB email?

    I find the solution on below scenario, any help appriciated.

    User open a receipt email and click the 'reply to all' "."

    It is possible to perform any action on the button 'reply to all '?

    Thank you

    You can not interact with native applications except for adding your own menu entry (entries).

  • Change color to the overview and click

    Hello

    I have stock dynamics created symbols:

    MouseEnter: change color when the mouse is on the button.

    Mouseout/mouseouthandler(): to reset the color when the mouse is in progress to another button.

    And I have problem on the click event, because I can't keep the blck color, which means clicking on the symbol, as I have a mouseout/mouseouthandler() that reset.

    Here is the code:

    $.getJSON ("menubuttons.json") (.the)

    function (data) {}

    $(données, fonction (index, item) {} .each)

    var menubtn = stage.createChildSymbol ("templ-menubuttons", "Stage");

    var menubtnelem = menubtn.getSymbolElement ();

    menubtnelem.Attr ("id", item.title)

    . CSS ({"background-size': 'contain', 'left': 1256," top":"95px","cursor":"pointeur"});})

    menubtn.$("txt").html (Item.title);

    MouseOver

    menubtnelem.on ("mouseenter", function () {}

    If ($(this) .attr ("id") = "Exit") {}

    TweenLite.to (menubtn.$("imageholder"), 0.3, {backgroundColor: 'red', left: '2px'});

    }

    else {}

    TweenLite.to (menubtn.$("imageholder"), 0.1, {backgroundColor: 'black', left: '2px'});

    }

    });

    Mouseout/mouseouthandler()

    menubtnelem.on ("mouseleave", function () {}

    TweenLite.to (menubtn.$("imageholder"), 0.1, {backgroundColor: '#ffcf00', left: '0px'});

    });

    Click

    menubtnelem.on ("mousedown", function () {}

    With 'for' I'm trying to reset the color of all the yellow buttons and then one that is clicked to be black - but does not work - how is Possible to work?

    for (var i = 0; i < data.length; i ++) {}

    TweenLite.to (menubtn.$("imageholder"), 0.1, {backgroundColor: '#ffcf00', left: '0px'});

    }

    TweenLite.to (menubtn.$("imageholder"), 0.1, {backgroundColor: 'black', left: '2px'});

    });

    });

    });

    This may help - it's not created dynamically well symbols, but it can give you an idea how to solve your problem

    Bind / unbind help please

  • Change the orientation of the mouse. Click the apple icon, and then select check box on the left. However, this box is covered by a video on the use of the mouse. How to remove the video?

    Change the orientation of the mouse.  Click the apple icon. System Preferences; OK to this point; the area to select 'Left hand' is covered by a video on the use of mouse clicks. How can I remove the video (s) so I can't select 'Left hand' in the box?

    System Preferences > mouse, and then select the tab more moves.

    Then on the left, select: slide between pages

    Click scroll left or right with one finger , and then make your choice.

    You cannot delete the video. This is a demonstration.

  • If time machine is incremental how it removes previous versions when the disk is full, without breaking the chain, so do not be able to restore all changes since the first full file

    If time machine is incremental how it removes previous versions when the disk is full, without breaking the chain, so do not be able to restore the file with any changes made since the full backup first file...

    If the TM drive storage is full TM automatically deletes the version the oldest files for the new incremental backups can be made. Thus, in this case you cannot restore the versions that TM deleted because it takes more storage.

  • When I updated to 11.7 Reader on Mavericks I did by default. How do I change back to the default preview. When I updated to 11.7 Reader on Mavericks I did by default. How do I change back to the default preview.

    When I updated to 11.7 Reader on Mavericks I did by default. How do I change back to the default preview?

    Hi lonsec,.

    Please follow the steps mentioned in the link: http://digitalwriting101.net/content/how-to-make-preview-the-default-pdf-reader-on-a-mac/

    Kind regards

    Rave

  • How to check the position of the mouse

    Hi, I am trying to do a drag and drop and validate it, now I have my slide - déposer but I can't validate if I drag the right answer to the right place.

    Is it possible to check the position of the mouse, so when I'm draggin I use smth like:

    If (mouseX = 50 & & mouseY == 100) {}

    My answer is correct

    } else {}

    incorrect ansewer

    }

    Please help me =)

    Hello, a tutorial by Paul Trani I looked on this topic has really helped me:

    http://paultrani.com/2013/03/follow-mouse-movement-in-edge-animate/

    In it, I would use the variables posX and posY to influence your function
    I hope this helps!

    Katherine

  • How can I stop auto scroll when the mouse pointer is placed on the scroll bar

    When the mouse pointer is placed on the scroll bar, it goes into an auto mode, scroll upward or down very fast scrolling. Happens on file selection windowswith any application, it must be Windows.

    Too bad. It was a matter of Firefox.

Maybe you are looking for

  • I got disabling hardly find my ipad

    Hello I sent my ipad for repair but I need to disable find my ipad so that the company can repair my ipad. Concerning Arthur

  • Re: Satellite A500 - Windows error recovery

    I have a problem with my laptop When I restart my laptop, it tends to be stuck on this windows error recovery screen. It gives me two options(1) Lauch Startup Repair(2) start Windows normally Tried both, it turns off, reboots that it ends on the same

  • Kit Kat restore Image - 4400US - NULL?

    Dear HP, Just curious to know why the picture of restoration Kit Kat is now NULL and only the Jelly Bean Image is the only option available for download for the Extreme 7 slate? ZiCott

  • Error install civ 4, "feature transfer error".

    I am running windows 7 and trying to install civ4. When you download the 2nd disc it says "feature transfer error" (cyclic redundancy check data error check) if any body know wat this means or can help out me that would be great.

  • BlackBerry smartphones can not get HTML email on my BB 8320 curve

    Guys, I just download OS 4.5 and 4.6 DM successfully, everything works fine... except error in Email (HTML view cant) and Yahoo! Go. Read all possible solutions here, but don't works do not. I have re - send the book service, restart the BB handset s