Need to 'margins aside"to restrict the movement of the movieclip that follow mousee

I like to keep the movement from left to right my movieclip that follows the mouse restricted within a 'margin' (excuse my not knowing the technical term if there is one) so it remains inside 75 pixels to the right and left side of the edge of the stage and does not go beyond.

Here is my code:

mouse_x = _xmouse;

setProperty (_root.hand_mc, _x, mouse_x + ((getProperty(_root.hand_mc,_x)-mouse_x) / 2));

Thanks to anyone who takes the time to read this. This forum is GREAT!

in fact, the code is meaningless since your specifications are meaningless.  This movieclip is unable to be at the near left and right margins.  Did you mean you want this movieclip edges limited to not less than 75px on the scene?  that would be wise and you can use:

this.onEnterFrame = f;

function f() {}
_root.hand_mc._x = (_root.hand_mc._x+_xmouse)/2;
If (_root.hand_mc._x<75)>
_root.hand_mc._x = 75;
} ElseIf (_root.hand_mc._x > Stage.width - 75 - _root.hand_mc._width) {}
_root.hand_mc._x = Stage.width - 75 - _root.hand_mc._width;
}
}

Tags: Adobe Animate

Similar Questions

  • Why should I update to the 'New' Firefox, when, by doing so, I have to Disable Symantec? If your system doesn't work well with it, so I'm in a dilemma, because I need this program to offer all the protection that I absolutely need the Web.

    I get a pop up asking me to upgrade to the new Firefox, but then I get a notice that the upgrade will not work with Symantec, my Norton account that protects my machine of various things on the Internet. I just won't do that. He must either find a way to do the upgrade works with Symantec, or buy some other, equal protection for me.

    Firefox is not disable the entire program Synmantec, just the Symnantec of extensions for Firefox. And these extensions can be easily updated to the new version of Firefox by running a Symantec / Norton Live Update, the new version of Firefox is installed.

  • Restrict the records that duplicate during data entry bulk of the multi record details

    I have three fields (empno, edate, deptno) in an overtime_d block. I want to restrict it to duplicate entry. can u please guide me

    Hello
    It should useful to you.

    http://SheikYerbouti.developpez.com/duplicates/duplicates.htm

    Mark useful/correct.

    Iqbal

  • MagSafe adapter does not work after all the stuff that followed and merge card Ok?

    My Megasafe duck-head adapter used with a Macbook pro has stopped working while my back was turned!

    After trying all the controls and the actions described in the Apple support pages, it always dows not turn on or show any current to the small pins when checked with a multimeter.

    It is the death of the adapter or can it receive some kind of CPR?

    Chris.

    Hello!

    Could specify you which checks and actions you have done already?

    Your MacBook came with both a cable to connect to the power supply and plug adapter. Could you try both to see if it works? You might just have a broken charger.

    Please find instructions for that here: reset the management system (SCM) controller on your Mac - Apple Support

    If the battery is good behaviour

    1. Stop the Mac.
    2. Plug the MagSafe or USB - C adapter to a power source and to your Mac.
    3. Use the built-in keyboard, press shift-control-Option on the left side of the keyboard, then press the power button at the same time.
    4. All the keys to unlock, then press the power button to turn on your Mac

    If the battery is removable

    1. Stop the Mac.
    2. Unplug the MagSafe from Mac power adapter.
    3. Remove the battery. (Learn about removing the battery in the MacBook and MacBook Pro computers).
    4. Press and hold the power button for 5 seconds.
    5. Reconnect the battery and the MagSafe power adapter.
    6. Press the power button to turn on the Mac.

    Thanks for posting the results!

    -Nils

  • Cancellation of the dialog that follows a button is pressed

    The problem I have is I open the dialog box and push my button to call another script to run.  But if there is an error the error is hidden behind the dialog box.  I would call the dialog box, push button, and then close my dialog box before the script runs.  This can be done.

    So far, I have tried this and can inspire them to do what I want.

    SubButton4_EventClick (ByRef This) ' set the event handler

    CallUIAutoRefreshSet (0)

    Call dialog.cancel

    Callscriptinclude ("D:\_Calterm_Configuration_Files\Technical_Information\DIAdem_Scripts\Insite_DataLog_FileLoader.VBS")

    CallUIAutoRefreshSet (1)

    End Sub

    Hello J,

    Which command you use to start your SUDialog?

    SudDlgShow()

    SudDlgCreate()

    The code you posted was for the recall of Dialog.Cancel - want - you NOT to close the SUDialog after all?

    Brad Turpin

    Tiara Product Support Engineer

    National Instruments

  • How to find which series of my laptop is and the numbers that follow

    For some reason, my camera software has been uninstalled and I am trying to find a way to recover. I have all the information such as the serial number, product number, etc.. But may not know what mine is. Appreciate any comment.

    IRV.

    Look at the bottom of the laptop.

    It could also be under the battery.

    REO

  • Get the movieclip that is hidden

    Can I get the name of a clip that has been hidden by referencing the name of the mask?

    var someMC:MovieClip = new MovieClip;

    someMC.mask = someMask;

    Now, if I didn't know that someMC was the element being hidden - can I get with someMask?

    Square.Mask = circle;

    trace (Square.Mask.Name);

    circle

    trace (Circle.Mask.Name);

    place

  • Scene make dark when the movieclip is opened. AS3

    I am trying to create an effect that when someone clicks on a button, it opens a movieclip.  I want everything behind this movieclip to dark so that the only option is to click a button in the open movieclip.  Does anyone know how to do this?

    You could probably create a movieclip that is a stage size black box that you make visible/invisible if necessary and place just behind the movieclip selected in the index of the child order.  The first thing you need to do is to get the movieclip that was clicked to the highest index of the children in the film (numChildren-1) and the black movieclip would be awarded to the second highest high... (numChildren-2).

    You may need to assign a set of event listeners pout with the dummy event handler functions to the black area in order to block whatever it is clickable below.  The alternative would be to have something that disables all other clickable objects until disappearance of the black area.

    If your background is black, another approach would be to do everything except the movieclip that was clicked invisible.

  • Help! I need this movieclip to follow the cursor but only in some details!

    Hello

    I'm rather new to action script and need a bit of a kick in the right direction.

    This is what I have a problem with - I used this code to the movieclip background follow the cursor:

    {onClipEvent (enterFrame)}
    x = _root._xmouse
    y = _root._ymouse
    _x +=(x-_x)/10
    FLF +=(y-_y)/10
    }

    I want however - restict movement is so it remains hidden behind the other black point with the graphic "hglf".

    I hope this makes sense and someone can help out me!

    Thank you

    You assign the instance names in the properties panel, or use the library names?

  • I need to stop a download of the query, I thought a stand-alone application but turns require a higher level (FCPX) as a 'parent' and I do not who have, or want to buy.

    I need to stop a download of the query, that I thought a stand-alone application but turns require a higher level (FCPX) as a 'parent' and I do not have that, or I want to buy it.

    Motion IS a stand-alone application. It is mainly designed to make effects for Final Cut Pro X, but it is not necessary to have with FCPX nor is it necessary to have FCPX to create projects for other purposes. When you open the query, simply select project of work outside the FCPX motion. You can save regular projects of Motion anywhere on your system.

  • Restrict the reources on the IOM resources profile

    Hi all

    It is possible to restrict the resources that appear on the profile of resources.

    I have a requirement where directors AD should o nly manage their resources.

    Thank you
    M

    Go to the resource object and remove the allow all check box, it will not be displayed in the resource file for all users

    Also check the layout of the Admin object only

    Thank you
    Concerning

    Published by: Surendra Singh Khatana April 7, 2010 23:39

  • The box that asks if I'd like firefox to remember this password is not pop up, how to activate it?

    I need to know how to activate the box that asks if I'd like firefox to remember this password.

    Normally when you install Firefox this feature is enabled by default. You can check the status in the Options dialog box:

    the button Firefox orange (or the Tools menu) > Options > Security tab

    In the second section, there is a checkbox for "Remember passwords for sites". These articles have more information:

    Now... some websites add code to the fields on their forms to block the AutoComplete (which blocks also save connections), so that you can find some sites where Firefox will not save the password for this reason. It may be some workaround solutions, we discussed several times for Yahoo! mail, for example, but since they are long to describe, please post if the problem is specific to the site and provide if possible a link to the login form.

  • Installed Windows 7 on my HP Compaq nw8440 but unable to find the drivers that only Vista drivers are ther

    I just install Window 7 Home Basic Edition as final Version was my HP Compaq nw8440 too slow. After installation, I am unable to find the drivers and all drivers available for Windows Vista. No driver VGA, No Finger Print etc. And the Internet is also working slowly well my connection giving the same speed. Please help me

    You are the very welcome.

    I do not take up that simple...

    Try the driver windows 7 for her at the link below and you will need the W7 software protect tools because I do not think the Vista software works.  Ditto for the quick launch buttons.

    These drivers have been extracted from the 6910p who was the first series HP business notebook, support for windows 7 and the one that follows in the line after the nc6400 (the 14.1 "model of your screen).

    http://h20000.www2.HP.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&swItem=ob-66699-1&prodTypeId=321957&prodSeriesId=1839152

    http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=321957&prodSeriesId=3357377&prodNameId=3357378&swEnvOID=4053&swLang=13&taskId=135&swItem=ob-78740-1&mode=3

    http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&prodTypeId=321957&prodSeriesId=3357377&prodNameId=3357378&swEnvOID=4053&swLang=13&mode=2&taskId=135&swItem=ob-77198-1

    Paul

  • reverse the timeline of the MovieClip (parent).salma.text

    certainly this code works fine but the other side is error


    Btn1.addEventListener (MouseEvent.CLICK, btn1Down);

    function btn1Down(event:MouseEvent):void {}

    MovieClip (parent).salma.text = "you pressed the button 1";

    }

    means textfield salma is failed name located in the parent timeline. here your btn1 located in the timeline of the child.

    My question is what is the inverse of the timeline?

    Btn1 will be located in the parent timeline and textfield salma is located child

    apply this code, you will get the error. But anyway to solve the problem?

    the movieclip that contains salma needs an instance (on this relative chronology) name, for example, c1.  You can then use:

    Btn1.addEventListener (MouseEvent.Click, btn1Down);

    function btn1Down(e:MouseEvent):void {}

    C1.Salma.text =' you you press the button 1';

    }

  • Gallery of images or the Lightbox that works for DW CS6?

    Help! I need a gallery of images or the lightbox that works! I tried the Lightbox Gallery in Widgets and all this works for the most part, do not show the nav buttons and I put the files in each directory (path) as possible. Does anyone have a solution for this - I read the forums for hours about it. OR is there something that is easy and quick and works? And if all goes well free?

    Thank you very much!

    The first thing I noticed is that you're missing your departuretag

    After repairing this error, run your page through the validator here: http://validator.w3.org/ and clear to top all others. HTML errors are one of the biggest culprits in bad/bad display problems.

    In addition, please download the page to a location to test on your website so that we can see the code in action in a real browser, it's the only real way to tell you what goes wrong in about half of cases of something like what is happening. Once the problem has been resolved, you can delete the directory on your server.

Maybe you are looking for

  • Can I change my default search to google.uk?

    I live in France. I run Ubuntu 14.04 (English version) on a laptop computer in French In Firefox if I get a term search in the search box, use Google.com for results. It is not useful for me - I really want to use Google.uk I tried different ways sug

  • How to remove Web site

    I would like to know is possible to delete history websites? I know there is a way where you can simply click on history and press on delete but is there a way to delete all of this Web site as a whole instead of click on remove each site with his na

  • 6835e HP: it will not be printed.

    I am not able to print. Problem with printhead bed printer. I did everthing asked unplug the printer from power source, turned the machine off, then on, etc. I replaced the ink with new and it worked 1 time, then return to problem with printhead

  • Does my SX260 read jpg that I browsed PhotoShop and loaded onto an SDHC card

    I use pictures originally taken with the camera. I'll download and treat them with PhotoShop. Then, I use a card reader to load them onto an SDHC card, which I then put in the camera. The question is to know if I'll be able to see the images on the s

  • Printer HP laserjet MFP Pro M127fn & 125: we have a big problem with this printer

    We have 20 printers or more M125fn and M127fn, we have problem with printing on the fonts Geo_Times, Geo_Times "BOLD", Geo_Times Italic, Bold Italic Geo_Times, we have programs that work on this policy and no one can print the text on this subject, p