Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 550541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:17:57+00:00 2026-05-13T11:17:57+00:00

I’m trying to make some flash buttons with a mouse_over animation that plays in

  • 0

I’m trying to make some flash buttons with a mouse_over animation that plays in reverse on mouse_out. Now I have it working for one of my three movie clip instances.

I am using e.currentTarget.play() instead of having a function for each movie clip, but how do I do the same for my playReverse function? I tried putting e.currentTarget.prevFrame() instead of mc1.prevFrame() but it did not work. My code is as follows:

mc1.addEventListener(MouseEvent.MOUSE_OVER,mover);
mc2.addEventListener(MouseEvent.MOUSE_OVER,mover);
mc3.addEventListener(MouseEvent.MOUSE_OVER,mover);
mc1.addEventListener(MouseEvent.MOUSE_OUT,mout);
mc2.addEventListener(MouseEvent.MOUSE_OUT,mout);
mc3.addEventListener(MouseEvent.MOUSE_OUT,mout);

function mover(e:MouseEvent):void {
    stopPlayReverse();
    e.currentTarget.play();
}

function mout(e:MouseEvent):void {
    this.addEventListener(Event.ENTER_FRAME, playReverse, false, 0, true);
}

function playReverse(e:Event):void {
    if (mc1.currentFrame == 1) {
        stopPlayReverse();
    } else {
        mc1.prevFrame();
    }
}

function stopPlayReverse():void {
    if (this.hasEventListener(Event.ENTER_FRAME)) {
        this.removeEventListener(Event.ENTER_FRAME, playReverse);
    }
}

Any idea how I can fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:17:58+00:00Added an answer on May 13, 2026 at 11:17 am

    Your function playReverse only use mc1 how can it work with the others movie clip.

    If you choose to do it that way you can keep a track of the current MovieClip playing in reverse.
    You will have to add more logic if you want that the play in reverse always finish when passing over one clip to another.

    var currentMovieClip:MovieClip=null;
    
    function mout(e:MouseEvent):void {
        var mc:MovieClip = e.currentTarget as MovieClip; 
        if (mc !== null) {
         currentMovieClip = mc;
         this.addEventListener(Event.ENTER_FRAME, playReverse, false, 0, true);
        }
    }
    
    function playReverse(e:Event):void {
        if (currentMovieClip==null) {
           return;
        }
    
        if (currentMovieClip.currentFrame == 1) {
            stopPlayReverse();
        } else {
            currentMovieClip.prevFrame();
        }
    }
    

    Another way that implies that you can have each clip to finish their play in reverse

    function mover(e:MouseEvent):void {
        stopPlayReverse(e.currentTarget as MovieClip);
        e.currentTarget.play();
    }
    
    function mout(e:MouseEvent):void {
        var mc:MovieClip = e.currentTarget as MovieClip; 
        if (mc !== null) {
         mc.addEventListener(Event.ENTER_FRAME, playReverse, false, 0, true);
        }
    }
    
    function playReverse(e:Event):void {
        var mc:MovieClip = e.currentTarget as MovieClip; 
    
        if (mc.currentFrame == 1) {
            stopPlayReverse(mc);
        } else {
            mc.prevFrame();
        }
    }
    
    function stopPlayReverse(mc:MovieClip):void {
      if ((mc!==null) && mc.hasEventListener(Event.ENTER_FRAME)) {
        mc.removeEventListener(Event.ENTER_FRAME, playReverse);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.