Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Start/Pause Animation

Community Beginner ,
May 27, 2012 May 27, 2012

Greetings all!

So I have this animation with one layer for the movie clips, and one layer for actions.

When I mouse OVER a hidden button, I want to cause the base animation to animate something from frame 2 to 6, then pause for user interaction.  Once the mouse OUT is detected on that same button, frame 7-11 should insue, then pause for user interaction (simulating a reverse movie clip).  I need to do this with 8 buttons, with 8 different animations.

I figured out after stupid amounts of trial/error and almost giving up twice to get the OVER/OUT mouse event to work, however the "stop();" command (obviously without the ""s) will NOT stop the root animation at frame 6, like I command it to in the action layer at frame 6.  It will continue to play to the very end, AND on TOP of that, not only will it NOT stop like commanded, but the stop(); command at frame 11 will also not work, making the entire animation loop playback so long as mouseOver is detected.  Soon as mouseOut is detected, the animation goes to frame 1.

Now, if I was to make frame 6 the last frame (destroying the possibility to make the backwards animation I NEED) then the stop(); command at frame 6 will work, the mouseOver event will work perfect, but there will be NO mouseOut event to speak of, and that's useless to me.

Here is frame 1 action layer code, with 11 frames of animation, stop(); at frame 6 and gotoAndStop(1); on frame 11:

stop();

import flash.events.MouseEvent;

right_btn.addEventListener(MouseEvent.MOUSE_OVER, onOver);

right_btn.addEventListener(MouseEvent.MOUSE_OUT, onOut);

function onOver(event:MouseEvent):void{ 

gotoAndPlay(2);}

function onOut(event:MouseEvent):void{ 

gotoAndPlay(7);}

TOPICS
ActionScript
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , May 27, 2012 May 27, 2012

SUCCESS!!!

I had the button with the MOUSE_OVER event ONLY IN FRAME ONE!

So the listening event for mouse over detected the button mouse over event in frame one, PLAYED frame 2-6, even STOPPED at frame 6 with the stop() command, but when it reached the stop() command in frame 6, it saw that there WAS NO BUTTON in frame 6, there for automatically detected a MOUSE_OUT event, thereby playing frame 7-11, STOPPING at frame 11 like it's commanded but then AGAIN detecting NO button, and re-looping back t

...
Translate
Community Expert ,
May 27, 2012 May 27, 2012

put a stop() on frame 6 of your "base animation".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 27, 2012 May 27, 2012

Thank you for your response.

stop(); and/or stop()  did not work when inputted into frame 6 of my base animation.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 27, 2012 May 27, 2012

Update:  It seems after reading several Flash posts, there are others who are having the same problem.  For some odd reason, AS3.0 is IGNORING stop(); commands.

I guess AS2.0 is what I need. *frown*

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 27, 2012 May 27, 2012
LATEST

SUCCESS!!!

I had the button with the MOUSE_OVER event ONLY IN FRAME ONE!

So the listening event for mouse over detected the button mouse over event in frame one, PLAYED frame 2-6, even STOPPED at frame 6 with the stop() command, but when it reached the stop() command in frame 6, it saw that there WAS NO BUTTON in frame 6, there for automatically detected a MOUSE_OUT event, thereby playing frame 7-11, STOPPING at frame 11 like it's commanded but then AGAIN detecting NO button, and re-looping back to frame 1, thereby creating a feedback loop neverending.

SOLUTION:  I kept the button in frame 1, placed the symbolized button in frame 6 to keep the frame locked at 6 until the MOUSE_OUT event was triggered, which works perfectly.

*FLIPPEN WHEW*

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines