-
1. Re: Endless Reverse Animation
Ned Murphy Jan 22, 2014 6:29 PM (in response to mentalcase129)The key to stopping the reverse timeline travel will be to remove the event listener like you do in the function you showed, just have it happen in the rollout function without the conditional.
-
2. Re: Endless Reverse Animation
mentalcase129 Jan 29, 2014 5:05 PM (in response to Ned Murphy)I'm sure if I'm understanding that. If I remove the even listener won't that stop the reverse animation from starting when I want it to?
-
3. Re: Endless Reverse Animation
mentalcase129 Jan 29, 2014 5:49 PM (in response to mentalcase129)Sorry, that should say "I'm NOT sure if I'm understanding that."
-
4. Re: Endless Reverse Animation
mentalcase129 Jan 29, 2014 5:58 PM (in response to mentalcase129)Actually I've been playing with this and I'm wondering about trying something else. I have a movieclip now that is playing and stopping based on mouse over and out events. What can code can I use to make a different button make it play backwards or stop based on mouse over and out events. Is there a simple code like movieclip.reverse() or something?
-
5. Re: Endless Reverse Animation
Ned Murphy Jan 29, 2014 7:00 PM (in response to mentalcase129)No, when you want to go backwards along a timeline you have to provide your own means of repeatedly moving back one frame at a time. That is where the ENTER_FRAME event listener comes in handy as you can use it to manage repeatedly calling the prevFrame() function. As I indicated in my original response, the key to stopping that backward movement is to remove that ENTER_FRAME event listener.
-
6. Re: Endless Reverse Animation
mentalcase129 Feb 5, 2014 5:14 PM (in response to Ned Murphy)Okay...I THINK I'm understanding you. Unfortunately my situation has changed and it's not quite the same. As far as I can tell anyway. So I changed my approach so that the rollover and out actions were starting and stopping a movieclip. I discovered that the forward moving animation wasn't working as well as I had originally thought. Changing to this approach solved that problem but now that I've done that reverse animation code I had been using no longer works at all, because that code is made to reverse the animation on the timeline that the code is sitting on. I need to make the movieclip play backwards from the same timeline that the buttons with the rollover codes are sitting on. I hope I'm explaining that well enough.
So I need to either adjust my code or come up with some new code that will tell that movieclip to play backwards. as appose to playing the present timeline backwards. Is that possible.
-
7. Re: Endless Reverse Animation
Ned Murphy Feb 5, 2014 5:51 PM (in response to mentalcase129)It is likely possible but you'll have to show code and explain where that movieclip is relative to the code
-
8. Re: Endless Reverse Animation
mentalcase129 Feb 5, 2014 7:26 PM (in response to Ned Murphy)Here's the code. It's sitting on the maintime with the button that controls the rollover and out events and the movieclip which has the animation within it that I want played and reversed. The forward action and stop works fine but not that backward action.
gallery.stop();
/* Mouse Over Event
Mousing over the symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is moused over.
*/
right.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler);
function fl_MouseOverHandler(event:MouseEvent):void
{
gallery.play();
}
/* Mouse Out Event
Mousing out of the symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is moused out of.
*/
right.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler);
function fl_MouseOutHandler(event:MouseEvent):void
{
gallery.stop();
}
/* Mouse Over Event
Mousing over the symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is moused over.
*/
left.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler_2);
function fl_MouseOverHandler_2(event:MouseEvent):void
{
var targetFrame:int = 1;
// if we are ahead of the target, start going backwards
if(currentFrame > targetFrame) stage.addEventListener(Event.ENTER_FRAME,goBack);
function goBack(evt:Event):void
{
prevFrame();
}
}
/* Mouse Out Event
Mousing out of the symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is moused out of.
*/
left.addEventListener(MouseEvent.MOUSE_OUT, fl_MouseOutHandler_3);
function fl_MouseOutHandler_3(event:MouseEvent):void
{
stop();
}
-
9. Re: Endless Reverse Animation
Ned Murphy Feb 9, 2014 4:49 PM (in response to mentalcase129)I don't know what object you are trying to target with your code, but whatever one it is is not being targeted if you are not using its instance name anytime you want to control it or test something of it. Consider using the following if "gallery" happens to be the movieclip you talk about...
gallery.currentFrame
gallery.prevFrame();
gallery.stop();
stage.removeEventListener(Event.ENTER_FRAME,goBack); // if you do not remove the listener it will continue to call the goBack function
Do not nest your goBack() function inside your fl_MouseOverHandler_2 function


