Easy: Just drag a movieclip autour

Hey all,.

I am trying to get this working, just dragging a movieclip around the stage, no limits yet simply, easy simple drag

That's what I have so far:

import flash.display.Sprite;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
to import flash.geom.Point;

menukaartGebruik_mc.buttonMode = true;
menukaartGebruik_mc.addEventListener (MouseEvent.MOUSE_DOWN, startSlepen);

function startSlepen(evt:MouseEvent):void {}

trace ("startsleep");
evt.target.startDrag (false);
stage.addEventListener (MouseEvent.MOUSE_UP, stopSlepen);
}

function stopSlepen(evt:MouseEvent):void {}
menukaartGebruik_mc.stopDrag ();
trace ("stopslepen");
}

Now what happens when I click, it's that flash record the fact that I'm clicking on it and dragging it, and when I release it knows that I stopped sliding. But nothing happens with the movieclip, it just stays there without moving.

What I would also like to know is if it is possible to limit the movement to a single axis, the Y axis.

Any help?

GRTS!

With the exception that you could aim something that you didn't know the use of "evt.target", this code works fine with a simple clip.  Try using "evt.currentTarget" instead, or better yet, since you use it in the trail of the stop, just use the movieclip instance name.

To limit the movement to the y-axis, you must define a rectangle that has zero width and whatever height you must allow to drag.

Example: startDrag (false, new Rectangle (0, 0, 0, yStopBot));

Find the Rectangle class to see how to specify its arguments

Tags: Adobe Animate

Similar Questions

  • Can I just drag - drop all of a sudden?

    Hello

    I placed like the obects below (bcz I want to achieve throughput / flowed subforms), am a beginner, so I screwed up like below in the hierarchy, now bcz of reason (if I use as it is lower in 2nd page, the alignment is spoil), I want to spend all the nodes / 2nd page objects on the 1st page, therefore, to make quick & easy, think just drag - drop page 2nd red top-level node to the decline at the bottom of first page with the technique to hold cusrsor , pls let me know is safe / any precaustions (there are very very litttel JS)?

    My_First_Page1

    Subform

    Subform

    text field

    Subform

    text field

    just text

    Subform

    Subform

    text field

    Subform

    Subform

    Subform

    text field

    just text

    Subform

    Subform

    text field

    Subform

    Subform

    Subform

    text field

    just text

    My_2nd_Page2

    Subform = > can I drag / drop this top-level node to the bottom of page 1 St?

    Subform

    text field

    Subform

    text field

    just text

    Subform

    Subform

    text field

    Subform

    Subform

    Subform

    text field

    just text

    Subform

    Subform

    text field

    Subform

    Subform

    Subform

    text field

    just text

    Thank you

    In the hierarchy on the left tab, simply mouse click and hold, then drag it to anywhere in your page 1.

    If all your objust respect this subform, they will also. If any other subforms are on the same 'level' you would have to select them separately or pressed cntl and click to select multiple

  • How can I put shortcuts to websites in a bar (?) tool bar/browser... dunno what it's called. With IE, I can just drag the tab of the site to the area I want.

    How can I put shortcuts to websites in a bar (?) tool bar/browser... dunno what it's called. With IE, I can just drag the tab of the site to the area I want

    Near the right end of the address bar is a White Star which can be hard to see, but look closely. When you want to add a shortcut to the toolbar, double-click the star. A window opens with the name of the Web page. Under this is the area of folder which will probably read "Unsorted Bookmarks". Click on the drop down arrow and change it to "Bookmarks Toolbar", then click done.

    I have several folders on my toolbar such as music, Mail, etc. in which I add several Web sites. If you want to add a folder, click on the second drop-down arrow next to "Bookmark Toolbar" and click on "New folder" and give it a name.

    To add a bookmark to a folder, once again double click on the star, make sure you're in the bookmarks bar and click one of the fall of two arrows to find the name of the folder.

    For other bookmarks use Menu bookmark. What is added here are accessible through bookmarks in the menu bar. If your Menu bar with bookmark, file, display, etc. is not visible, click the ALT key and they will become visible. To keep the menu bar, click view, toolbars and check the menu bar.

  • Apple pencil will not work, just drags the page around

    LLA pencil has Bluetooth connected to my Pro, but don't shoot on all apps. I tried sending notes.  It's just dragging the page around as. A cursor. I missed a step somewhere?

    Here are the basic instructions for your comment.  You've literally paired your Apple pencil for the iPad?

    Use the pencil to Apple with iPad Pro - Apple Support

  • By dragging the movieclip symbol

    Hi all

    I am referring to a source code available online and up to now arrived at this point and the existence of the problem. Currently at work so can't provide details ALSO, but about the problem is the following.

    I had the scene with other elements. The flash made box is supposed to appear after a user click on a button symbol. There are 2 buttons of symbol that will be clicked and show the 2 done flash box one at a time.

    I made a movieclip symbol which covers the entire scene with alpha 0. A transparent movieclip. are entered into the movieclip and created the 1st done flash window with 3 images on each layer on a total of 6 layers which are headers, header, upbtn, dwnbtn, bg, dynamic textfield. 1 setting of each layer is empty frames. 2nd frame of each layer contains the things mentioned above.

    the 2nd flash render window is the same order as above, but they reside on the 3rd frame of each layer instead of 2nd frame. Thus so, 1e-2e framework on this 2nd flash window is empty. This means that these 2 done flash windows lies in the same movieclip, but at different levels and different frames.

    Hope that everyone can get the picture I'm painting here.

    After the publication, I click the btn symbol, ONLY the dynamic textfield was released. the rest of the upbtn, the dwonbtn, the headers, the header, bg are all invisible. BUT, when I put my cursor to the position where the above items are supposed to be, work items. I can drag, close it, highlight the textfield and down using inclinometer. Sometimes the other symbol of btn as well.

    How is it that they are invisible? I try to put the layer of transparent movieclip symbol on the bottom of the folder, it still does not work. If the problem lies in the transparent movieclip, then why does the textfield appear? I went from the TextField to the layer below in the movieclip while the rest of the layers as headers, header, bg, upbtn and downbtn are on top of it. but it still does not work.

    I don't think that's the number code, but more on the layers and frames the subject also drag and closing activities. does the dynamic textfield scrolling using the upbtn and downbtn.

    Please help me. Thanks in advance.

    In the end, I looked for other examples and found a way to use another method.

    It is to play with the visibility. Quite lame. but I had no choice.

  • Why can't just drag photos on my desktop with Sierra 10.12 and Photos 2.0?

    I used to be able to simply drag a photo from Photos or iPhoto directly on the desktop of my iMac.  Then, I was able to drag the photos located on my desktop to eBay, Craigslist or other sites that I use to sell items.  Now, it seems I have to use a visit to first export the photos to the office, open finder, click Desktop and THEN dragging them to my desktop iMac computer.  Am I missing something or is this the new method to move photos on my iMac desktop.  I apologize for what may be a very stupid question, but I can't help but feel that I lost the ability to make effective use of the Photos and my iMac.  For any help or suggestion is greatl

    By dragging from the photo browser to the computer desktop still works for me.  As soon as I drag to an empty space on the desktop the pointer turns into a green '+' and I can put the photo.

    If it does not work for you, there could be something problematic about the photos you want to drag.  Photos can be edited or exported? What is the file type of the photos you are trying to drag-and - drop?

    Using iCloud photo library? You have iCloud allowed to sync your desktop and Documents folder with iCloud?

  • When I try to highlight the text my cursor turns into a hand/fist who just drag the page. I need to be able to highlight, copy and paste text.

    I have to be able to highlight text on web pages, copy and paste. But when I click on my mouse left button, he made a hand / fist which simply dragged the page.
    How can I get to where I can highlight text?

    Start Firefox in Safe Mode to check if one of the extensions (Firefox, Tools/menu key > Modules > Extensions) or if hardware acceleration is the cause of the problem.

    • Put yourself in the DEFAULT theme: Firefox, Tools/menu key > Modules > appearance
    • Do NOT click on the reset button on the startup window Mode safe
  • I can't just drag and drop photos into a folder in the order I want them?

    Windows XP and Vista allowed me to put pictures in the order I want. How do I do that in Windows 7?

    Manually with the photos in a folder by drag & drop...
    is not an option in Windows 7.

    The following article may be worth it.

    (FWIW... it's always a good idea to create a system)
    Restore point before editing the registry)

    Proceed at your own risk *.

    How to disable the automatic reorganization in Windows 7 Explorer have free tri
    http://www.SevenForums.com/tutorials/92758-Windows-Explorer-auto-arrange-disable.html

    Good luck...

  • Just drag and drop them confirmation prompt? Accidentally move files.

    Since the upgrade to Windows 7, we had a problem with people who inadvertently move files by drag-and - drop when the meaning of double-click.  Is there a way to turn on a quick confirmation ("are you sure you want to... ") when drag / drop files/folders?  It seems that the previous versions of Windows had this prompt, but it has since been removed.  What is happening in our offices at least every week, sometimes every day, and we have to spend a lot of time searching for the moved folder.  If MS can't help, is there software that we can buy for this?

    Windows 7 has made no changes: there has never been a request for confirmation that you describe.

    One solution is to increase the distance you need to move the pointer before it triggers a drag.  Under the following registry key, you will see DragHeight and DragWidth, which define the number of pixels the mouse must move before the start of the operation drag is:
    Computer\HKEY_CURRENT\USER\Control Panel\Desktop
  • Hi good so I'm very frustrated because I am new to Photoshop and I try to use the quick selection tool. I see all these online videos of how it is easy (just click on the image). However when I do this my tool spazzes just outside and cr

    I am incredibly frustrated. Overall, taken my quick selection is done and I can't get a simple selection to change the background. It is simply a crap tone of weird lines and stupid circles and its stressing out me too. Help, please.

    There is a bug that should be fixed soon.

  • Drag & Drop of TextEdit.app and Preview.app not work - El Capitan

    I keep a shortcut to Textedit.app in my toolbar of Finder. This used to make the text of opening files in really easy: just drag and drop the icon. But this no longer works with El Capitan. Simply, it shows the icon "prohibited" and does not open the file.

    The same behavior occurs if I drag-and - drop to the TextEdit application in the Applications folder. Forbidden! Preview also suffers the same obstacle.

    Does anyone know how to re - enable drag-and - drop behavior for these applications?

    Why, El Capitan prohibits this action? It worked fine in all my previous versions of Mac OS x. (at least of the Tiger).

    Please remove items from the toolbar and re-create them.

  • OE6 questions mailbox compacting

    I had upgraded to IE8 and didn't like it so I went down to 7 and started having a problem with OE6.  He constantly asks me to compact my mailboxes (about once every two or three minutes where OE is open on my main identity) prior experience I dare not compact without saving first but it is extremely annoying.  I checked the size of the .dbx files and Inbox is the largest 1.5 G.  I have several inboxes for emails different years appointed a year, I need to access.

    If I have to, I can move some of the .dbx files to a different folder.  It's easy just drag back in the identity folder and create a relationship with the mailbox again.   My main identity is only a total of 9.5 G scattered among 20 .dbx files.  What is the cause of my problem?

    Thanks for any light that can be made on this issue.

    The reception and sent items box is perhaps already damaged. If you have no luck compaction, move all messages from these two folders to the user created folders.

    Close OE and delete the files Inbox.dbx and Sent Items.dbx in the message store. New files and folders will be automatically generated when you open OE.

    Bruce Hagen
    MS - MVP October 1, 2004 ~ September 30, 2010
    Imperial Beach, CA

  • make a contact group

    I went through the whole upward to a contact group, but I cant find it anywhere.  Went to programmes, Contacts etc, but this is not. And none of the email addresses I put in it, are now in my contacts list.  I find the "make a new contact group" button in the address book, but when I add the names, I can only find a couple of them in my address book. Is it possible to have two address books?

    Is it possible to fill a group of contacts, step by step so that I don't have to send an email instead of 20.  It was so easy, just drag the names in a single address, and who sends an email to all addresses.

    Hope you can help me!

    Nanny Moo

    Missing the Windows Contacts toolbar buttons
    http://www.vista4beginners.com/missing-buttons-from-Windows-contacts-toolbar

    Vista - "New Contact" and "Contact Group on new" button missing
    http://www.Vistax64.com/tutorials/186477-new-contact-new-contact-group-button-missing.html

  • The file update incorporating

    Original title: Integration of file

    Any change in the position on the question below? Almost five years after the original question - or is it just a pipe dream?

    I recently bought a laptop running on Windows 8. Nothing has changed with regard to the possibility of integrating files in folders (see my question on November 5, 2010). The biggest impact for me would be safety backup. If I can integrate all my important files for backup in a single backup folder so it would be very easy just drag this folder in, for example, a security vault on a SanDisk to have the latest version of each file encrypted as a back-up. This would save a lot of time, any chance of that any time soon?

    Well, I don't really have anything to do.  The backup task runs according to a schedule and performs a backup in this folder regularly for me.  If I wanted to drag my backup to another drive (such as a USB or network or something), I could do that at any time.  In fact, you could plan even just that to happen after the backup job every night, if you wanted to.

  • Path of the file on the Mac network server

    Whenever I have to create a link, I need to dig 7 clicks to get the files from site that I'm looking.

    I just started using a Mac, with sites located in a network SMB server. Therefore, this issue could be associated with Mac/Samba.

    (When you work on a PC all paths to the site for the files I was working on locally attached by default to the root of the current site.)

    I am currently working on sites located on a network. I set sites on the Mac. However, when I open the file on the network server and try to create a link, the default file browser in the Documents directory on my local Mac system. So I click 6 clicks to enter the correct network directory. This occurs for each link. I hope that there is something that I can change somewhere to set the path of current default file of the document being edited.

    Thank you.


    > Then when I click on properties to create a link, the file browser
    > default values
    > in the locale of the CMA Documents folder.

    Oh! Gotcha! Yep, that's how it works on my Mac. Rather boring.

    It might be better/easier just drag the link icon to your site window for
    make the connection in this way, or if they are images, just drag the images of
    part of your site on your page.

    -Darrel

Maybe you are looking for