How to Play animation on Mouseover and Reverse on Mouseout?

0down votefavorite
I am trying to create a simple animated navigation bar. I want to mouseover an image and have an animation play, then when you mouseout the animation will play in reverse.
I can get the animation to play on mouseover, but as soon as I put in the mouseout code it doesn't work. I'm completely new to Edge, so if someone can give me a simple explanation on how to play/reverse an animation on mouseover/out, I would really appreciate it.
Right now I have an image, converted to a symbol, with another image (nav_on_1) nested inside. The image nested inside is animated with the label "nav_on_1_play".
My code for mouseover is below:
sym.$("nav_on_1").show();
sym.play("nav_on_1_play");

first I recommend that you use mouseenter and mouseleave instead.
second: if you have a symbol that has let's say one animation you can do
on mouse enter
sym.getSymbol('symbolname').play();
on mouseleave:
sym.getSymbol('symbolname').playReverse();
you may have to add
sym.getComposition().getStage().getSymbol('symbolname').play();
sym.getComposition().getStage().getSymbol('symbolname').playReverse();
or you can put the event in stage/compositionreday
sym.getSymbol('symbolname').mouseenter(function(){
sym.getSymbol('symbolname').play();
sym.getSymbol('symbolname').mouseleave(function(){
sym.getSymbol('symbolname').play();

Similar Messages

  • Play sound on mouseover and mouseclick

    I have buttons on my website. I want them to swap image and play sound  on mouseover and mouseclick. Dreamweaver has a behavior for swap image, and it used to have a behavior for play sound but they took that away after cs5 and I have cs6, so does anyone know the code I can manually enter and where I'm supposed to enter it? I'm an idiot when it comes to computer languages so can you just give me the exact code that I can copy and tell me where to paste it. the sound file I want to play on mouseover is images/button a.wav, and the sound i want to play on mouseclick is images/button b.wav. thanks for any help
    ps
    I also know the sounds  can be annoying to some people so is there a way to aslo a make a mute button for just the button sounds(i have videos that have required sound that I need to play), if so could you tell me how

    I lied no it didn't work, it worked until I added the swap images.Here's the code with the swap image but the sound not working  <td rowspan="2"><img src="images/index_r2_c2.jpg" width="185" height="95" id="Image1" onmousedown="MM_swapImage('Image1','','images/down_r2_c2.jpg',1)" onmouseup="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','images/roll_r2_c2.jpg',1)" onmouseout="MM_swapImgRestore()"<a href="#" onmouseover="playSound('images/button b.wav');"onmousedown="playSound('images/button a.wav');"></a></td>, what's wrong with it

  • How do i do a forward and reverse sweep two independent variables

    Hi,
      So I was looking through the post on how to do a forward and reverse sweep with a real-time x-y plot. I have a similar situation except that instead of sweeping (forward and reverse) of one variable, but instead two variables (in my case, I call it gate voltage G-S Volt and source-drain voltage S-D Volt). I understand how to do it with one variable as provided in previous posts, but I am caught when I add another variable to reverse sweep. I have attached my vi to this post. Any suggesstions is greatly appreciated. Thank you. Also, a little more details on my plot, I am plotting current vs gate voltage which forward and reverse sweepeing (gate and source-drain voltage)..
    Attachments:
    FET_Isd - Vg measurement_Vg_201.vi ‏45 KB

    jasonct,
    It is very difficult to follow what your code is doing. It violates all of the style guide and good practice recommendation for LabVIEW code.
    The diagram should fit on one screen. SubVIs can help.  Generally dataflow eliminates the need for sequence structures.  Stacked sequence structures in particular obscure the code. Local variables are prone to race conditions, violate dataflow, and are not needed for the uses you are making of them.  Wiring should go right to left, with minimal numbers of bends.   Comments documenting what you are doing are helpful to others looking at your code and to you next month when you wonder why you did it that way.
    Lynn 

  • How to play stereo mix music and sing in my mic at the same time?

    Hi guys, need help regarding Realtek HD audio driver
    I want to play stereo mix music and sing in my mic at the same time.... not for recording purposes but in chatroom let's say.
    I'm using XP...Toshiba Satellite S4747 laptop
    In the Realtek software under " Realtek HD audio input" I have mic and stereo mix both.... but I can only select one at a time.....
    Any solutions plzzz thxxxx
    On a different note.... a friend of mine whose using one non-Toshiba laptop with win XP has an older version of the Realtek audio driver and can select both mic and stereo mix at the same time... I downloaded that version into my laptop but I still can only select one at a time....

    Check the audio settings in Windows and dont forget in Realtek HD audio manager. You can find it in control panel.
    I think your microphone is set to mute so check this.

  • Sliding panels continuously on mouseover and diconnected on mouseout

    hi all!
    i'm using sliding panels on my site and i was wondering if
    there is a
    way to slide the panels continuously on mouseover and
    disconnect slide on mouseout?
    thanx...

    Hi,
    create rowcolor.js and paste this code,
    rowcolor.js
    // JavaScript Document
    function navRollOver(oTr)
    if (!oTr.contains(event.fromElement)) {oTr.bgColor="FF0000";}
    function navRollOut(oTr)
    if (!oTr.contains(event.toElement)) {oTr.bgColor="#EFEFEF";}
    then in your table file (html,jsp) code this in <head> section
    <script LANGUAGE="JavaScript" src="rowcolor.js"></script>
    in <tr> add this line
    <tr ONMOUSEOVER="navRollOver(this)" ONMOUSEOUT="navRollOut(this)">
    <td> your value </td>
    <td> your value </td>
    </tr>fyi
    buddy, this forum for java , not javascript, avoid next time

  • How to play Animation with site loading in background to reveal website?

    So I know there are pre loaders and you can make that with edge... But they are so small and just a little circle moving around or something... I more mean a full page pre-loader then I guess...
    I have created an animation of a M with marquee lights going around and slowly zooming in... Then I have the M fade out and I have a black solid layer move up and another black solid layer move down to reveal the blank stage below...
    What I want to happen is maybe with some java script but to have the solids move out of the way to reveal my site bellow... Anyone know how to accomplish this?
    Thanks so much! I think being able to do things like this in native html and css and java will be huge for giving websites a "Font Door" or Opening Title like we have in movies... Thanks so much!

    first I recommend that you use mouseenter and mouseleave instead.
    second: if you have a symbol that has let's say one animation you can do
    on mouse enter
    sym.getSymbol('symbolname').play();
    on mouseleave:
    sym.getSymbol('symbolname').playReverse();
    you may have to add
    sym.getComposition().getStage().getSymbol('symbolname').play();
    sym.getComposition().getStage().getSymbol('symbolname').playReverse();
    or you can put the event in stage/compositionreday
    sym.getSymbol('symbolname').mouseenter(function(){
    sym.getSymbol('symbolname').play();
    sym.getSymbol('symbolname').mouseleave(function(){
    sym.getSymbol('symbolname').play();

  • How to play podcasts in order, and how to pick up where I left off?

    I have several music podcasts I listen to. I made Smart playlists for each, so the podcasts show up in Playlists. Two questions: How do I play them in order? And, after I pause after listening to one, how do I continue listening when I wish? With the previous generation (the one with video capabilities), I could highlight the Smart playlist in Playlists and click the "play" button...all podcasts would play in order. If I switched away from the podcast and listened to the radio or even a different podcast, my Nano would remember where I left off. I love the new Nano and its tiny size, but the podcast thing is driving me batty. Thank you for your help.

    Okay, I'm a dork. I accidentally swiped my volume screen this morning, and discovered the answers to all of my questions.

  • How to play game on Facebook and watch movies on internet, How to play game on Facebook and watch movies on internet

    Flash player ???

    Flash player is not supported and probably never will be : http://www.apple.com/hotnews/thoughts-on-flash/ . Also Adobe have failed to create a version that works on iOS devices and have apparently now given up trying.
    Depending on what sites you are trying to access, you might find that some of them (probably more so if they are news sites) have their own apps in the App Store which might let you get some of the content that you want (and there is the built-in YouTube app). Also there are browsers such as Skyfire, iSwifter and Puffin which 'work' on some sites - but judging by the reviews not all sites.
    If you want to play flash games then you are probably out of luck if you want to play on-line though the iSwifter app might work on some of them, but again some flash games have app versions in the store (I think that a few of the Facebook games have app versions, some of which link in to your facebook account).

  • How to play Apple iWatch Video and other new product video

    I eagerly went to view video on Apple's new products, such as the iWatch, but I cannot get the video to play. 
    Does anyone have an idea why this link does not load and play?
    http://www.apple.com/iphone-6/films/#video-product
    I am on a 2.93 GHz Intel Core i7 iMac with 8 GB of memory running Mac OS 10.6.8

    Hi ..
    It's not the website that's the issue.
    If your Mac is running v10.6.8 Snow Leopard, that OS X is outdated as well as the version of Safari that runs on v10.6.8.
    Apple Kills Snow Leopard: OS X 10.6 No Longer Receives Security Updates
    See if your Mac can upgrade to Mavericks >  OS X Mavericks: System Requirements
    That would also install a newer version of Safari so you can view the Apple product videos.
    Mavericks is free and available at the App Store.

  • Walkman : how to play only local files and no network related media.

    Hello All.
    The Walkman app is a nice player.
    But...how can i configure it that it only shows local files on my sdcard1 ?
    I don't want to use network streaming, i just want to listen to my local stored (huge) collection flac files.
    Is disabling 'music unlimited' all i need to do? (i use a €3,- for 3 months action from playstation4)
    ∆○×□ PSP1004 (Phat 1st gen.) 5.00 M33-6 (+1.50) + 32GB Pro-Duo.
    ∆○×□ PS4 1.7X + 500GB hdd + Dualshock4 + PS4 Camera,
    Xperia-Z1 Android 4.4.X + 32GB microSD + Philips SHB9100
    Solved!
    Go to Solution.

    Thanks for the fast reply.
    Cool, it saves my mobile data bundle when i'm on the bike. (out of wifi range)
    I was a bit confused about artists i don't know, but those are the demo songs, i'll remove them using AndExplorer.
    ∆○×□ PSP1004 (Phat 1st gen.) 5.00 M33-6 (+1.50) + 32GB Pro-Duo.
    ∆○×□ PS4 1.7X + 500GB hdd + Dualshock4 + PS4 Camera,
    Xperia-Z1 Android 4.4.X + 32GB microSD + Philips SHB9100

  • I dunno how to play mp3 in my new mac :( i'm a newbie, pls help!

    please tell me how to play mp3 on mac and i got some files transer from my pc, but i dunno how to open it here.. is there any ways to learn how to use macbook? thx alot!

    Hi yy7772: This is where the mac excels: to play mp3 files, you use iTunes (included). For all other Mac type quest ions check out this site: http://www.apple.com/support/switch101/
    Happy Listening
    Stedman

  • Regarding FBRA - Reset and Reverse.

    Hi,
    I am ABAPer and trying to prepare BDC for transaction FBRA. I want to use option 'Resetting and revers'. While recording when I go for save option in FBRA, it concludes the recording as I am pressing save button and goes for first default option 'Only Resetting'.
    I would like to know, how I can go for 'Resetting and reverse' option through recording?...Is there any other option than 'save' I can use and continue recording with 'Resetting and reverse' then please let me know?
    Thanks.

    Solved..FB08 or F.80 can be alternative, Thanks.

  • Play animation in reverse

    Hey. Im a total noob at actionscript and flash so please explain to me like I´m a seven year old!
    I made a flash banner that includes a videofile and some vector animations. I would like this banner to play from fram 1 to the last fram and then reverse play back to frame 1 ad infinitum (the whole movie should do this that is). I cant just reverse the frames though, because of the videofile (at least I think so?) - so Im guessing I must write some kind of script that tells the movie how to play. Any ideas on how to accomplish this?
    Thanks

    first frame:
    import flash.events.Event;
    var boolVal=true;
    addEventListener(Event.ENTER_FRAME,fEnter);
    function fEnter(evt:Event)
    if(boolVal)
        nextFrame();
    else
      prevFrame();
    and to the last frame:
    var boolVal=false;

  • Playing animations in reverse

    Hi there,
    I have a script that i use to run animations in my models, but i would also like to be able to play them in reverse as well.
    For example, i have a series of buttons that i use to trigger parts of my animation. Button 1 runs 0-2 sec, Button 2 runs 2-4 sec and button 3 runs 4-6 seconds. Now if i decide to press my buttons in reverse order, i'd like to see my animation running in reverse, such that button 2 will now play 6-4 sec and button 1 will play 4-2 seconds.
    I hope this all makes sense.
    Has anyone come across this before?
    Does anyone have any scripts that they're willing to share?
    I can provide the script that i'm currently using if this will help anyone with this problem.
    Cheers,
    George

    George,
    Here's a script that will play your animation in reverse. To play in reverse successfully, you should set the default "Animation Style" to 'none' in the 3D properties dialog. Otherwise, the C++ animation routine will collide with the Javascript engine. (You can imagine how that might happen!).
    Here's the script for reverse:
    //=======================================
    //get the first animation in the scene and create control vars
    firstAnimation = scene.animations.getByIndex(0);
    firstAnimation.speed = 3;
    firstAnimation.oneFrame = 1 / firstAnimation.framesPerSecond;
    scene.activateAnimation(firstAnimation);
    //run the animation using a TimeEventHandler()=================
    myTimer = new TimeEventHandler();
    myTimer.onEvent = function(event)
    firstAnimation.currentTime -= firstAnimation.oneFrame * (firstAnimation.speed * 0.1);
    if (firstAnimation.currentTime <= firstAnimation.startTime)
    firstAnimation.currentTime = firstAnimation.endTime;
    scene.update();
    runtime.refresh();
    runtime.addEventHandler(myTimer);
    //=======================================

  • I have ordered a movie from Apple TV and found it would take 10 hours and 27 minutes to down load. How do I stop it, and reverse my order????

    I have ordered a movie from Apple TV and found it would take 10 hours and 27 minutes to down load. How do I stop it, and reverse my order????

    The problem is generally due to a slow internet connection.
    AppleTV files are fixed size.
    For SD you need 2.5Mbps, 720p HD 6 Mbps and 1080p 8 Mbps sustained speeds to view immediately.
    If your internet delivers these speeds you should be able to play within seconds.
    If slower AppleTV works out how long it will take do download the rental of say 3.5GB for a 720p movie, then subtracts the running time of the movie and whatever that figure is is how long it'll take to start.
    So if a movie is 2 hours long and you have a fast connection and it calculates the movie could download in under 2 hours it'll play withing seconds.
    If it thinks it'll take 4 hours to download, it'll subtract the running time of 2 hours and allow you to play in 2 hours time.
    While this may not seem ideal the reason is that if it didn't precahce on a slow connection you would not be able to play a movie through without stopping and starting to cache the next section.
    Unfortunately this is compounded by using the AppleTV for other things as this can reset the clock by flushing any of the rental cached.
    AC

Maybe you are looking for

  • Safari keeps crashing every time I open it. Cannot get online.

    Safari crashes when I try opening it. I can't get online to get another browser. I've been trying to get a genius bar appointment but I can't get past the screen asking what type of support I want. What is going on?!?

  • Problem in Selection Screen.

    Dear Experts, I am facing a problem in Selection Screen. <b>I have 2 radio buttons ,</b> <b>Radio Button 1</b> - Choosing the file from desktop and <b>Radio Button 2</b> - Executing from Database Under Option1 - i have a <b>FILE</b> parameter which i

  • I can't find the software update  for the ios5 on air update

    Where can I find the software update option for iOS 5 on air update on iPad2. Not able to find it in current settings menu

  • My navigation toolbar doesn't work properly.

    Normally, after i write the site i want to navigate (e.g : www.yahoo.com), and press enter, the site start navigate automatically. But now, after i press enter, nothing happens. It's not even loading. My enter button is working properly. (i've tried

  • Sequence of trigger firing in forms 6i

    hai, please reply soon .. i need full details about sequence of trigger firing when form initiate, query mode,modify mode,delete mode and insert mode in forms 6i . regards, B.prakash