Is it possible to play an animation by clicking and dragging?

I currently have right and left arrow buttons to control an animation.
I was wondering if it's possible to control the animation by dragging the mouse? So if the user clicked and dragged the mouse to the left it would play the animation, then when they released the click it would stop. And if they dragged to the right it would play in reverse.
I've been looking around and haven't found anything on this topic. Any help would be appreciated.

Hi, cameronnicol-
The code should work on the Stage, as it's internally just a symbol.  You should ensure that you reference the object as Stage in your code and not stage (note the capitalization).  The other thing to consider is that click and drag events are not very performant on devices; touch events generally register very quickly and will give your users a better experience.
-Elaine

Similar Messages

  • I would like to play an animation by click and then play reversed by clicking again...

    ...like a menu popping out and going back again. How is this possible? Probably very simple.

    Elaine,
    What's the avantage of using sym.setVariable and getVariable rather than the simple code below? Isn't it basically the same?
    // on off button example
    var toggle = true,
    sym.$("btn").click(function(){
              if (toggle){
                        toggle=false;
                        sym.$('Ellipse').hide();
                        sym.$('btn').html('Off');
              else{
                        sym.$('Ellipse').show();
                        toggle=true;
                        sym.$('btn').html('On');

  • Is it possible to play different sounds for emails and instant messages ?

    Hello,
    I was wondering if it was possible to play different sounds for emails and instant messages. I am using Thunderbird quite often with both emails and instant messages imported from Gtalk.
    I think it would be very convenient to be able to distinguish both sounds as they do not imply the same things.
    Thank you very much.
    Olivier Hubert.

    There are only six chat add-ons, three of them are about notifications. Pick one you think will do the job for you. https://addons.mozilla.org/en-US/thunderbird/extensions/chat/?sort=popular

  • Mouse click and drag through turntable animation

    Hi all,
    First - thanks for taking the time to look through and possibly helping me with this question.
    I'm just getting to grips with flash cc actionscript 3.0 - so I apologise in advance to my not so technical jargon.
    In the past I have used actionscript 1.0 to create an interactive html file that contains a turntable animation of a 3D model. Users can mouse click and drag to the left or right to 'spin' the model around - however what they are really doing is scrubing through the timeline which contained 360 images of it from 360 degrees. Similar ideas can be found here: Interactive Thyroidectomy
    Now annoying I can't use the old code any more as I'm working in the latest flash cc actionscript 3.0
    So how do I do the same thing but in actionscript 3.0?
    So I've worked this bit out so far
    On my main stage I have two layers - actions layer and another layer with my movie clip (movieclip_mc)
    In the actions layer so far:
    movieclip_mc.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
    movieclip_mc.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
    function onMouseDown(event:MouseEvent):void
      movieclip_mc.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
      //I should put something in here about mouseX  - but no idea what
    function onMouseUp(event:MouseEvent):void
      movieclip_mc.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
    function onMouseMove(event:MouseEvent):void
    //I have to put something in about total frames - width of movieclip_mc etc but I'm not sure how   
    // this is what someone else did on another forum - but I'm not sure what it means:
         var delta:int = backgroundClip.mouseX - clickedMouseX;
       var wantedFrame:uint = (clickedFrame + delta * clip.totalFrames / backgroundClip.width) % clip.totalFrames;
       while (wantedFrame < 1)
      wantedFrame += clip.totalFrames;
      clip.gotoAndStop(wantedFrame);
    Also I think i need something in the beginning like.....:
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Sprite;
    var clickedMouseX:int;
    var clickedFrame:uint;
    var backgroundClip:Sprite = getChildByName("background") as Sprite;
    var clip:MovieClip = getChildByName("animation") as MovieClip;
    clip.stop();
    clip.mouseEnabled = false;
    .....but I'm a bit confused about what all of it means
    So I understand the principle but no idea how to actually make it work - Could anyone help explain it to me or help with the code?
    Thanks so much to anyone who can offer some help
    Catherine

    Hi Ned,
    sorry to bother you again on this subject -
    the script...
    function onMouseMove(event:MouseEvent): void {
      movieclip.gotoAndStop(Math.round(mouseX/movieclip.width*(movieclip.totalFrames-1))+1 )
    worked fine - but when you click and drag on the movie clip it didn't always get to the end of the movie and never carried on through the frames back to the beginning like i wanted it to (such as this one does Interactive Thyroidectomy)
    So I went back to the older 2.0 script and played with it a bit to be :
    function onMouseMove(event:MouseEvent): void {
      changeDistance = movieclip.mouseX - startX;
      travelDistance = startFrame + changeDistance;
      if (travelDistance > movieclip.totalFrames) {
      movieclip.gotoAndStop (travelDistance % movieclip.totalFrames);
      } else if (travelDistance < 0) {
      movieclip.gotoAndStop (movieclip.totalFrames + (travelDistance % movieclip.totalFrames));
      } else {
      movieclip.gotoAndStop (travelDistance);
    .... which almost works but it is very stuttery to mouse over and then it has this output error..
    mouseDown
    ArgumentError: Error #2109: Frame label 2.3500000000000227 not found in scene 2.3500000000000227.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 3.6499999999999773 not found in scene 3.6499999999999773.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 4.949999999999989 not found in scene 4.949999999999989.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 6.25 not found in scene 6.25.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 7.600000000000023 not found in scene 7.600000000000023.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 8.899999999999977 not found in scene 8.899999999999977.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 11.5 not found in scene 11.5.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 12.850000000000023 not found in scene 12.850000000000023.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 14.149999999999977 not found in scene 14.149999999999977.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 15.449999999999989 not found in scene 15.449999999999989.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    ArgumentError: Error #2109: Frame label 16.75 not found in scene 16.75.
      at flash.display::MovieClip/gotoAndStop()
      at flashdoc_fla::MainTimeline/onMouseMove()
    mouseUp
    I've obviously put some code in the wrong place - could you help me find out what it might be?
    I haven't labelled any frames odd numbers such as 15.4499999999999989 or labeled scenes than number either.
    I can send you my scene if that would help?
    Thanks very much for your time Ned
    (p.s Or maybe if it is easier you might offer some guidance as to how i can change the action script
    function onMouseMove(event:MouseEvent): void {
      movieclip.gotoAndStop(Math.round(mouseX/movieclip.width*(movieclip.totalFrames-1))+1 )
    to allow it to be more like Interactive Thyroidectomy

  • Playing simultaneous animations when clicking on a button

    Hello,
    Does anyone knows how to make two animations on the timeline in edge animate play simultaneously when i click on a button ?
    I have a button in my menu, when i click on it i need to play to animations from the timeline.
    Thanks for helping me.

    hey Vincent,
    Try adding the animation to a symbols and playing the symbols. When you make these symbols have auto play un-ticked as the animation will play automatically  from the start of the main timeline otherwise. Then on your button you can access the symbols by add code:
    sym.getSymbol("symbolname1").play();
    sym.getSymbol("symbolname2").play();
    If you don't want to put the code in yourself use the auto coder and you go playback/play/stage/symbolname1
    The play works the same as if it was on the main timeline so you can play from a label, time on the timeline or just leave play() to play from the beginning of the symbol.
    Hope this helps

  • ITunes 9.1 - CPU goes to 100% when playing prot. AAC - clicks and gaps

    Since downloading 9.1, there are clicks and gaps when I play protected AAC songs on iTunes. Songs play fine with QuickTime player. When a protected song is played in 9.1, iTunes absorbs all available CPU.
    I have followed all remediation steps in the apple.com support site including turning off sound enhancer, checking for driver updates, etc. I have also set buffering to maximum.
    If I play an AAC protected song for more than a few seconds it becomes impossible to pause it and all other applications running freeze. This happens even when there are no other applications running . . . it is not a conflict problem with other applications. itunes absorbs whatever cpu there is left to take. Consistently using 60-90% of CPU w/ total CPU @ 100% constantly (when an AAC protected song is played).
    iTunes works fine as long as the song is not protected.
    I cannot find anything on the apple site to allow me to go back to 9.0. Why can't apple allow one to step back to the previour version? I am seriously looking at getting permanently off of iTunes. Each new release is harder to use and performs more poorly.

    Unfortunately I have the same problem since I installed Itunes 9.1 anche this problem is shown in a lot of thread.....
    I am seriously disappointed cause I BOUGTH these music and it's unbelieveble that Itunes doesn't play its music (sorry for my english...I am writing from Italy...).
    I am afraid that it's an Intel Atom processor conflict.
    I have already update everything was possible to update (driver, codecs, setting audio configuration, energy saving...) but I didn't find any stuff to solve this issue...

  • Do your MP3s play back with digital clicks and distortion on new iPad?

    I have thousands of MP3s encoded to 192 in my iTunes library that have played flawlessly on my iPods, iPhone, first-gen iPad and Macs with no problems. All the MP3s played back on my third-gen iPad (ATT 4G) randomly have clicks and digital distortion through them. These clicks and distortions don't always happen in the same place and not always with the same file. This points to a problem with the iPad. Anyone else having this problem?

    Thought I may as well post some additional photos consisting of my iPad compared to my sisters iPad 4;
    Mine is the top iPad, sisters is the bottom iPad.
    Close-up of my sisters iPad, same side;
    The camera doesn't capture the full glory of the back-light bleeding, you can just imagine how much worse and more apparent it would be to the human eye!
    (With these images, I have enchanced the brightness so it's more apparent)

  • Can I play DVD on my PC and stream it to Apple TV ?

    We don't usually buy movies online and we're not going to do that in the future. So is it possible to play DVD on my laptop and watch it on my big screen through ATV ?

    There is a way around this. You can "rip" the DVD on your PC and then import the "ripped" movie into iTunes and then you can stream it via ATV2 to your TV.

  • In iphoto, videos not playing when I double click it.

    My pics are fine when i double click but not my videos. I have to click and drag the video to quicktime on the bottom and when it does play, its really laggy and slow, help please, thanks

    Download Quicktime Player 7 from here: QuickTime Player 7 for Mac OS X v10.6.3 or later
    OT

  • Is it possible to play music videos on the Music App of my iPad 2? or it's only possible in the Video App?

    Is it possible to play music videos on the Music App of the iPad 2? Or create a playlist for the Video App? or sort the music videos by artist, genre, album, etc.?

    I have two music videos on my iPad and they don't even show up in the Music App - only in the Videos App so I have to conclude that you can only play them in the Videos App.
    I could be wrong - heaven knows it won't be the first time - but I see no way to play it in the Music App.

  • Is it possible to embedding a video in Keynote and then play as a PDF?

    Hi
    Is it possible to embedding a video in Keynote and then play as a PDF?  I want to do a PowerPoint/Keynote presentation that includes videos from YouTube.  My preference is use Keynote although I do have Office 2004.
    My issue is that the places where we present have their own equipment so we are encouraged to bring the presentation on a USB/portable HD, and they tend to be Windows environments.
    In my perfect (ignorant) world, I'd
    Create it in Keynote
    Add/embed videos from YouTube
    Save it as a multi platform file like a PDF
    I guess the key issue is:
    Is there a way to create a multi platform presentation with videos (I think Keynote and PPT require different video formats???) that can be carried on USB/portable HD?
    Thanks

    No, it's not possible without using hacks. And Adobe can't support or endorse hacks
    Bear in mind that not only there are new features in a new version which can't possibly be recreated by an older version - also, there are enhancements to existing features, which would make them render differently in the two versions.
    That said, there are people posting such hacks, as Sébastien pointed out.

  • Is it possible to play video directly from my GoPro2 using the connector kit and memorycard?

    Hi,
    I have the new GoPro2 action cam and a Ipad2. I bought the connector kit for memorycard and USB. I was hoping that I just could take the memorycard and upload the videos to my Ipad2, but I was wrong. I don't work! I have been filming on the highest quality resolution. It is only showing as an grey object.
    Can anybody help me with this, is it possible to play the movies?
    Regard
    Stanly

    It may not be compatible with the iPad. See below for reference.
    H.264 video up to 1080p, 30 frames per second, High Profile level 4.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats;
    MPEG-4 video up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats;
    Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format

  • Is it possible to play youtube video in safari browser on WiFi in iOS devices ?

    Hello Support,
    I have a query regarding playing you tube videos in iOS devices (like iphone,ipad). I can able to play youtube videos in safari browser in iphone on 3G data connection but can not play the same video on WiFi. I am facing the same issue in the youtube iOS application also. Is it possible to play youtube video on WiFi in iOS devices ? Please help me to fix this issue.
    Thanks

    My understanding is that you should definitely be able to play youtube videos using a Wi-Fi network. To me, it sounds as though the issue may be more network related as the videos will work over cellular data. I have a couple questions I believe could help narrow down the exact issue:
    • Is the device able to browse to other websites while connected to Wi-Fi, or will no sites work?
    • Are there other devices (iPads, iPhones, computers, etc) that work on the same Wi-Fi network?
    These are some troubleshooting articles that come to mind as well:
    http://support.apple.com/kb/ht4199
    http://support.apple.com/kb/TS1398

  • Is it possible to play civilization V with the macbook air

    Is it possible to play civilization V with the macbook air

    Civ V system requirements: http://www.aspyr.com/product/game_specs/125
    Check against the tech specs of your MacBook Air http://support.apple.com/specs/#macbookair
    Stefan

  • Is it possible to play an audio file out of labview (using myDAQ)?

    Hi all,
    I am using a myDAQ (first time). I am trying to play an audio file at a certain time in my VI.
    All the examples I have seen use the audio in and then play out of the audio out port. Is it not possible to simply find the file location and then play it out of the audio out under the given conditions in the VI or even import the sound? I am not trying to play large files or large quantities such as songs. I only want a congratulatory sound when the task is complete (2/3s).
    Any help would be is appreciated (even to say it isn't possible!)
    Cheers 
    Solved!
    Go to Solution.

    Why no just play a WAV file? Use Play Sound File.vi as shown here.
    Richard

Maybe you are looking for

  • Creating user defined function in sql server 2000

    I have created a udf an i want to call it in another udf. will u please help me out how to create. thank you

  • Printer not printing in center of page -can't move to left

    EMAIL: I cannot center the printing page.  It prints too far to the right. When I try to move it to the left, it still comes way off center toward the right side of the email.

  • Function modules called in update task

    Hi, I am calling two function modules in update task sequentially. I want to know whether these two function modules are also called sequentially in update debugging also? My code is like this 1. call FM1 in update task 2. Call FM2 in update task wil

  • Using XML Operation Tags to query by date

    Problem 1: When I use timestamps from items' XML to form queries on repositories, I receive SQL errors. Problem 1 Example: Query the PublishingRepository to find all active projects created on August 16. In Dynamo Administration, navigate to /atg/epu

  • Why is spotlight **** ?

    Can someone explain me why spotlight (among almost everything) is always indexing but not able to find anything ? Like avery Apple thing "you can't say that it doesn't work" you can only say that under most conditions it only works once in a while. W