Click and drag to control the frame advance

I have a layer that contains a video clip instance named wwr_mc, who has 19 frames. I figured out how to script, a function of turning constantly move from one image to the other by rolling on the prev or next buttons, using this code:

wwr_mc.gotoAndStop (10);

var t:Timer = new Timer (250.0);
var dir:int;

t.addEventListener (TimerEvent.TIMER, onNextFrame);

next_btn.addEventListener (MouseEvent.ROLL_OVER, Right);
next_btn.addEventListener (MouseEvent.ROLL_OUT, stopIF);
function right(e:MouseEvent): void {}
dir = - 1;
t.Start ();
wwr_mc.nextFrame ();
}
prev_btn.addEventListener (MouseEvent.ROLL_OVER, Left);
prev_btn.addEventListener (MouseEvent.ROLL_OUT, stopIF);
function left(e:MouseEvent): void {}
dir = + 1;
t.Start ();
wwr_mc.prevFrame ();
}
function stopIF(e:Event): void {}
t.Stop ();
}
function onNextFrame(e:TimerEvent): void {}
wwr_mc.gotoAndStop (wwr_mc.currentFrame + dir);

}

This type of navigation, although functional, isn't really codusive what I am trying to accomplish. I would like to be able to click and drag the mouse and have the frameworks to advance forward or backward according to the direction of movement of the mouse.

I tried to use the MOUSE_Move event with very limited success.

Any suggestions would be helpful!

Thank you!

I don't see anything through this link that I can relate to this announcement.

If you want to change managers only based on orientation (x) that the mouse is moved, then you need to test the current position of the mouse to the last known position...

var startPosition:Number = mouseX;

wwr_mc.gotoAndStop (10);

stage.addEventListener (MouseEvent.MOUSE_MOVE, onMouse);

function onMouse(e:MouseEvent): void {}
If (mouseX-startPosition > = 0) {}
wwr_mc.nextFrame ();
} else {}
wwr_mc.prevFrame ();
}
startPosition = mouseX;
}

I don't know what you find as being too fast.  When you do things from an event extended, such as a mouse moved for a while, then it is likely that the event runs the event handler function several times... as fast as the rate of the file allows it.  So if you want more control over the speed at which function nextFrame/prevFrame to mouse moves effect calls, then you must build in some form of delay.  In the example below, it takes the form to remove the mouse event listener move for a short period using a synchronization function (setTimeout in this example, but you can use the Timer class as well)

var startPosition:Number = mouseX;
var delayTime = 250; 0.25 s

wwr_mc.gotoAndStop (10);

stage.addEventListener (MouseEvent.MOUSE_MOVE, onMouse);

function onMouse(e:MouseEvent): void {}
stage.removeEventListener (MouseEvent.MOUSE_MOVE, onMouse);
var currentPosition:Number = mouseX;
If (currentPosition-startPosition > = 0) {}
wwr_mc.nextFrame ();
} else {}
wwr_mc.prevFrame ();
}
setTimeout (setListener, delayTime);
}

function setListener() {}
startPosition = mouseX;
stage.addEventListener (MouseEvent.MOUSE_MOVE, onMouse);
}

Tags: Adobe Animate

Similar Questions

  • The screen goes black when I click and drag text, use the version on my 18.0.2. Thank you

    I'm entering text in the space of your question and click on a Word to drag it to another location, or if I am writing something in an email on gmail and click on a part of the text to drag it to another part of the text, the screen goes black as soon as I start to drag the text

    -Installing and re - install, it's what makes work - although I've still "hardware... use" unchecked.

  • CS6 Illustrator crashes when click-and - drag to move the object.

    Run 16.0.5 on a MBP OSX 10.9.5 the retina. Whenever I try to drag an object to move, Illustrator crashes. I can click on an object/points and move with my keyboard arrow keys, but not with the mouse or trackpad. I have reimagee my machine, with all fees install cs, but the problem persists. All tracks for a solution are appreciated.

    e,

    The problem may be caused by the extension Chrome Pushbullet, see this post by Matt #3 with solution.

    https://forums.Adobe.com/message/6984777#6984777

    or by the Adobe color extension, see this post #2 of byhexxstatic with the solution,

    https://forums.Adobe.com/message/7095368#7095368

    or you could try to reinstall using step three way:

    Uninstall, run the cleanup tool and reinstall.

    http://www.Adobe.com/support/contact/cscleanertool.html

  • How to remove a folder in the sidebar and drag it to the desktop

    I've been working wth a folder and in any way, he got pinned to the sidebar. I tried right clicking and dragging. However, the ability to detach it and move it to the desktop is not available.

    Please help because I'm desperate to get work that I need in the folder.

    Thank you.

    Hello

    1. are you referring to the taskbar of Windows or the Windows Sidebar?

    2 are you able to access the folder and all its contents?

    I suggest to follow the article below troubleshooting steps and check to see if that fixes the problem on your computer.

    Customize Windows Sidebar

    http://Windows.Microsoft.com/en-us/Windows-Vista/customize-Windows-Sidebar

    Send us a screenshot.

    How i: post a screen shot on this forum?

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-security/how-do-i-post-a-screen-shot-on-this-forum/c86de820-C620-401c-A804-9f6337cd3053

    Hope this information helps you.

  • Click and drag the question (Beginner)

    Hello, so I have a very simple program where I would like the user to be able to drag the object to the statue and place it on a pedestal. I started with the click and drag, but the code did not work when I used it. I tried to use the code snippets of live code, and that no longer works. After a trace in the click function, I found that he has not been called. They are called the same, and the mouse_up function was working properly, then I don't know what the problem is. Any help would be greatly appreciated ~

    Here is the code, the important bits are in bold. I don't get any other error ~.

    package

    {

    import flash.display. *;

    import flash.events. *;

    flash.ui import. *;

    try public class extends flash.display.MovieClip

    {

    var rightIsPressed:Boolean = false;

    public void retry()

    {

    Add listeners to drag

    trace ("it's working");

    make the invisible instructions

    controlText.alpha = 0;

    call event listeners

    nextBtn.addEventListener (MouseEvent.CLICK, seeManga);

    startBtn.addEventListener (MouseEvent.CLICK, beginManga);

    controlText.addEventListener (MouseEvent.MOUSE_OVER, showText);

    controlText.addEventListener (MouseEvent.MOUSE_OUT, hideText);

    walkinganimation.addEventListener (Event.ENTER_FRAME, fl_MoveInDirectionOfKey_3);

    stage.addEventListener (KeyboardEvent.KEY_DOWN, fl_SetKeyPressed_3);

    stage.addEventListener (KeyboardEvent.KEY_UP, fl_UnsetKeyPressed_3);

    statue.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

    statue.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

    }

    function fl_ClickToDrag(event:MouseEvent)

    {

    var object = (event.currentTarget);

    object.startDrag ();

    }

    function fl_ReleaseToDrop(event:MouseEvent)

    {

    var object = (event.currentTarget ;)

    object.stopDrag ();

    }

    start the functions

    function showText(event:MouseEvent)

    {

    trace ("mouse in");

    controlText.alpha = 1;

    }

    function hideText(event:MouseEvent)

    {

    trace ("mouse over");

    controlText.alpha = 0;

    }

    function beginManga(event:MouseEvent)

    {

    gotoAndStop (2);

    }

    function seeManga(event:MouseEvent)

    {

    trace ("2nd button");

    nextFrame();

    }

    function fl_MoveInDirectionOfKey_3(event:Event)

    {

    If (rightIsPressed)

    {

    trace ("keyboard pressed');

    walkinganimation.gotoAndStop (2);

    Foreground.x-= 3.5;

    Text1.x-= 2;

    Text2.x-= 2;

    Text3.x-= 2;

    Text4.x-= 2;

    Pedastal.x-= 3.0;

    statue.x = 3.0;

    }

    }

    function fl_SetKeyPressed_3(event:KeyboardEvent):void

    {

    switch (event.keyCode)

    {

    case Keyboard.RIGHT:

    {

    rightIsPressed = true;

    break;

    }

    }

    }

    function fl_UnsetKeyPressed_3(event:KeyboardEvent):void

    {

    switch (event.keyCode)

    {

    case Keyboard.RIGHT:

    {

    rightIsPressed = false;

    walkinganimation.gotoAndStop (1);

    break;

    }

    }

    }

    }

    }

    Initially, you said that you don't get other errors, but you get the error messages at all?

    How you implement this class file in your Flash file?

    You happen to have anything that could block access to the object of the statue?

    To animate the object of the statue in place such that it is not named in frames before the framework where your code is trying to work with her?

  • Can't click and drag to select anything in the Apple Pages

    I worked for hours on this unanswered anywhere on the internet.

    I can't click and drag to select text in the Apple Pages. I can click and drag to select text in other applications on the same computer, but in the Pages, I can't click and drag. It will show the text highlight for a fraction of a second, and then it will disappear. I can't copy or cut, because it will not select it. If I select the text with clicking and then holding down the SHIFT key and then clicking on at the end of the text, he chooses for me. But clicking and slippery will only highlight, then disappear. What's wrong???

    I have

    • computer restarts
    • restarted apple pages
    • trashed plists iWork (cannot find a specific pages plist)
    • Troubleshoot-made form another computer by comparing the preferences, settings, all on the same version of Pages
    • sought objects to make them 'selectable' (there is no objects, and this happens on all documents, including new pages documents I just create and try to highlight a Word)

    I'm on an iMac OSx 10.11.5 end 2013

    Apple Pages 5.6.2 (2573)

    It is a long-standing problem in OS X, are not specifically in any version of the Pages. Have you tried clicking & holding it down for a second or two in the text before you drag?

  • Click and drag in the Favorites or in text fields does not

    Click and drag does not work with favorites anywhere, or any text fields. He used to work a lot in v11, but not v12

    I tried to revert to my version of Firefox v11 backup but it keeps automatically updated to v12 despite disabling auto update in the preferences and even when it is offline - frustrating.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

  • I click and drag the music from my library to a new playlist and some songs are dark and will not play on my device.  Why?

    I click and drag the music a new reading list, but some songs are not highlighted in the play list and will not play on my device.  Why?

    Try two things...

    (1) the songs greyed out can be unchecked. Uncheck the songs are normally excluded from track to track synchronization and normal. With the help of the songs or the list view Ctrl + click on an empty box to check all the boxes in the list of active reading.

    (2) try to go to file > library > Update music library to iCloud and do the update.

  • not by clicking and dragging the mouse

    My mouse pointer responds well to move around the screen and double check etc. However when I try to click and drag he 'loses' of the object (file name or Freecell card) or will not select what I go & drag. All the drivers are up to date. I removed, waited and then replaced the Bluetooth USB mount to the back of the computer and the batteries are charged. Any ideas?

    HP TouchSmart 520-1010ukH

    Mouse Microsoft MG-0982 model

    Windows 7

    Hello @itsmagicvi,

    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the Forums of HP, I would like to draw your attention to the Guide of the Forums HP first time here? Learn how to publish and more.

    I understand that you are having problems with your Microsoft Mouse on your home PC HP TouchSmart 520-1085uk not allowing you click and drag or use drag to select. I'd be happy to help you, but first of all, I encourage you to post what operating system you are using. And if your 32-bit OS or 64 bits like this that I can give you accurate information.

    Operating system Windows am I running?
    Is the Version of Windows on my computer 32-bit or 64-bit?

    Another thing you can try is the mouse on another computer to see if you encounter the same problem or if you are unable to do this test using a different mouse on your computer to see if the problem repeats.

    Will you please re-post with the information requested and I would be happy to provide assistance. Thanks for posting on the HP Forums. Have a great day!

  • When I click and drag a window to move its location on the screen does not move properly.

    When I click and drag a window to move its location on the screen does not move properly. It leaves a "track" of windows. Whatever the problem is scroll is also affected when the page moves in waves. Why he started to do this, and if someone can offer a solution? Thank you!

    original title: "leakage" of windows

    It is a common problem with how XP displays the items on your screen. When things get a bit bogged down, you'll start to see trails of the window as you drag. Unfortunately, there is no solution, but future versions of Windows do not have this problem with a new rendering of the graphics system.

  • The task bar is not locked, but he won't move in right or left clicking and dragging.

    original title: taskbar is not locked, but he won't move in right or left clicking and dragging. Tried a different mouse, no results.

    The task bar will not move but not locked.

    Click to the right or left mouse drag, nothing happens.
    Used another mouse, still no movement.

    Hello

    Method 1:

    Try to make an auditor of the system files on your computer and search for errors on the disc: How to use the tool File Checker system to troubleshoot missing or corrupted system files on Windows Vista or Windows 7 http://support.microsoft.com/kb/929833

    Method 2:

    Step 1:

    Start the computer in safe mode and see if the problem occurs. Follow the steps from the link to start in safe mode: http://windows.microsoft.com/en-US/windows7/Start-your-computer-in-safe-mode

    Step 2:

    Start the computer and check to see if this helps: How to troubleshoot a problem by performing a clean Windows Vista or Windows 7 boot http://support.microsoft.com/kb/929135

    Note: when you are finished troubleshooting, follow step 7 to start the computer in normal startup.

    Method 3:

    Step 1:

    Try creating a new user account and check if it works very well: http://windows.microsoft.com/en-us/Windows7/Create-a-user-account

    Step 2:

    If it works fine, then try to move the files and folders from the old account to the new user account user: http://windows.microsoft.com/en-US/Windows7/Fix-a-corrupted-user-profile

  • Click and drag the work for a few seconds then the work stoppages?

    Hi all

    See this video of drag and drop doesn't work does not in creative suite - YouTube https://youtu.be/QODs8fF84g4 that shows the problem.

    I have the same problem with Indesign, but not with the first where I can drag and drop, drag to prune, drag the elements, clips, etc.

    In photoshop I can click and drag in the layer order resort or to crop an image, etc., but after a few seconds, these functions do not work, and nothing happens at all when you click to drag. Layers are not locked, this happens with any project, no image, no matter if I open the program as an administrator or not. It is a Windows 10 computer and I'm on their beta program, but drag and drop works fine in windows/creation/other applications.

    What this may be? It worked fine a month ago.

    Help much appreciated.

    Select this option.

    The fact that you can't move the floating panels might indicate a problem with the mouse capture. When a mouse down is detected capture us the mouse and drag the user interface as you move the mouse.

    You use all third party tools that interact with the mouse?

    If you hold down the "shift" key when launching Photoshop, you can disable third-party plug-ins 3. You see the problem when you run without 3rd party plug-ins enabled?

    Jesper

  • When I choose my quick selection tool, I click and drag the first time, and he adds (my selection). BUT if I let go of the mouse button and try to select more it goes to Negative (-) and removes all selections I made and won't allow me not one

    When I choose my quick selection tool, I click and drag the first time, and he adds (my selection). BUT if I let go the mouse button and try to select it goes to Negative (-) and removes all the selections I made and not will not let me add again. I never had this problem before, you usually need to hold down the Alt (or Option MAC) to subtract from selections. No one knows what happened or how to fix this problem, maybe a setting I accidentally hit? Thanks for your suggestions! :))

    Look at the options of quick selection - particularly the four icons on the left.

  • Does anyone know why illustrator did several objects when I click and drag? No key keyboard shortcuts; only with the mouse.

    When I make a square for example, click and drag with the mouse, it makes duplicate objects until I release the mouse click. How can I disable this feature? Thank you.

    Danopoly,

    How can I disable this feature?

    By unstucking the Tilde (~) key.
  • Cannot left click and drag the clip in the timeline... Need advice

    Cannot left click and drag the clip in the timeline or drag autour clips in the timeline.

    Can be inserted into the timeline of the Source window, but cannot drag from the source window.

    Can cut and paste into the timeline.

    Cs5 restarting does not help, but restarting solves the problem for a while.

    Tried several mice, but that did not help.

    Have no idea how I got the name of FORMER PRO, must have been drinking champagne years, because I'm a blundering by excellence!

    Post edited by: old pro

    Problem solved by pressing the ESC key.

    Someone suggested that in order to heal the same problem in MS Word.

    Problem reappears and solves the ESC key.

    And now my life is complete!

Maybe you are looking for

  • El Capitan pending 10 hours does not load?

    Mid-2010 MAC OS X 10.6.8 3.2 processor i3, 4 GB 1333 3DDR. Try to upgrade to El Capitan for the last 10 hours. Shows only that the wait?  Went to the cat Apple support and waited 45 minutes with no response except to see the fall down with the specia

  • The 32-bit driver for the Photosmart 7760 isn't in Windows Update. Please post somewhere.

    I'm trying to install the driver for my Photosmart 7760 (7700 series) on a 32-bit version of Win7 and Windows update is stating, that it does not exist. I consult the list of drivers after their update by using the windows update button in the Add Pr

  • Serial number not found message at startup

    Hello Just night last series, I received message 'Serial number Not Found' at the start, followed by "Compilation Windows 7 7601 this copy of windows is not genuine". I tried to insert the product key for the label of the laptop, but that does not so

  • When I connect to my computer I get an error related to C:\Program Files\MSN Messenger\usnsvc.exe

    original title: usnsvc.exe Hello.I had the problem. When I opened my computer, this problem seen on my screen. C:\Program Files\MSN Messenger\usnsvc.exe, I couldn't find answers. can u help me? I use windows 7 64-bit. IM waiting for your answers. Tha

  • UCS Manager emulator - cannot launch KVM

    Hello I am a newbie to UCS. I work with the Cisco UCS to know about this emulator.  Manager of the UCS JNLP works very well. I'm launching the application of the KVM. I'm getting the following exception when loading of the KVM. I use java version 1.6