LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




ReplyREPLY THREAD
 
Thread Tools Display Modes
  #1  
Old 04-20-2009, 03:31 PM
[PAUL FERRIE]'s Avatar
[PAUL FERRIE] [PAUL FERRIE] is offline
Glasgow Flash Developer
 
Join Date: Feb 2005
Location: United Kingdom
Posts: 7,756
Rep Power: 16
[PAUL FERRIE] is on a distinguished road
Simple Movie Clip playing frame reverse

I am sure i have already answered this question recently but ere goes again since i can't find that post

There are two ways to do this.
1. onEnterFrame
Actionscript:
someButton.onRollOver = function() {
	playMC("for");
};
someButton.onRollOut = function() {
	playMC("back");
};
function playMC(dir) {
	switch (dir) {
		case "for" :
			this.onEnterFrame = function() {
				if (effectMC._currentframe<20) {
					effectMC.gotoAndStop(effectMC._currentframe+1);
				} else {
					delete this.onEnterFrame;
				}
			};
			break;
		case "back" :
			this.onEnterFrame = function() {
				if (effectMC._currentframe>1) {
					effectMC.gotoAndStop(effectMC._currentframe-1);
				} else {
					delete this.onEnterFrame;
				}
			};
			break;

	}
}

2. Using some tween class. In this example i am using Caurina Tweener
Actionscript:
import caurina.transitions.Tweener;
import caurina.transitions.properties.DisplayShortcuts;
DisplayShortcuts.init();
someButton.onRollOver = function() {
	playMC("for");
};
someButton.onRollOut = function() {
	playMC("back");
};
function playMC(dir) {
	switch (dir) {
		case "for" :
			Tweener.addTween(effectMC,{_frame:20, time:1});
			break;
		case "back" :
			Tweener.addTween(effectMC,{_frame:1, time:1});
			break;

	}
}

I have also attached both fla's
Playing frames in reverse using onEnterFrame
Playing frames in reverse using tween class
Hope it helps someone.
Also Blog'ed it
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- Site - Blog - Glasgow Flasher - Activeden

- bringmadeleinehome.com
Reply With Quote
  #2  
Old 04-21-2009, 03:50 AM
FlashMove's Avatar
FlashMove FlashMove is offline

FlashMove Master
 
Join Date: Jan 2000
Location: Singapore
Posts: 4,597
Rep Power: 10
FlashMove is on a distinguished road
Excellent tutorial there Paul
__________________
Actionscript tag . Donate Here . Testimonial . Join Flash Chat UserGroup . Twitter . Facebook
Reply With Quote
  #3  
Old 04-21-2009, 06:40 AM
[PAUL FERRIE]'s Avatar
[PAUL FERRIE] [PAUL FERRIE] is offline
Glasgow Flash Developer
 
Join Date: Feb 2005
Location: United Kingdom
Posts: 7,756
Rep Power: 16
[PAUL FERRIE] is on a distinguished road
Quote:
Originally Posted by FlashMove
Excellent tutorial there Paul 
Thanks. It feels like i have answered this question a few times in recent weeks
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- Site - Blog - Glasgow Flasher - Activeden

- bringmadeleinehome.com
Reply With Quote
  #4  
Old 06-26-2009, 08:03 AM
maxjustlogin maxjustlogin is offline
Banned
 
Join Date: Jun 2009
Location: United States
Posts: 1
Rep Power: 0
maxjustlogin is on a distinguished road
Useful code.
Reply With Quote
  #5  
Old 03-03-2010, 06:01 PM
SD Surfer SD Surfer is offline
Registered User
 
Join Date: Mar 2010
Posts: 1
Rep Power: 0
SD Surfer is on a distinguished road
"Previous" button to play Tweener in reverse?

Thanks for the share. I've been trying to figure out how to get a "Previous" button working in AS3 using something similar to this, but have been unsuccessful.

So, if i had several images all on their own frame and each with their own Tweener transition when navigated to that frame. Is it possible to have a "Previous" button that would not only go back a frame, but play the Tweener animation on that frame in reverse? I'm trying to make a nice AS3 slideshow complete with sleek transitions and next & previous buttons. I've been researching this for days...

"Previous" button code:
Code:
btn_previous.addEventListener(MouseEvent.CLICK, doprevClick);
function doprevClick(e:MouseEvent):void {
prevFrame();
}
Reply With Quote
  #6  
Old 03-04-2010, 02:10 AM
[PAUL FERRIE]'s Avatar
[PAUL FERRIE] [PAUL FERRIE] is offline
Glasgow Flash Developer
 
Join Date: Feb 2005
Location: United Kingdom
Posts: 7,756
Rep Power: 16
[PAUL FERRIE] is on a distinguished road
Can't say without knowing what's going on in these other frames. Can you post your fla?
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- Site - Blog - Glasgow Flasher - Activeden

- bringmadeleinehome.com
Reply With Quote
  #7  
Old 02-08-2012, 06:36 AM
xiaotuanzi xiaotuanzi is offline
Registered User
 
Join Date: Feb 2012
Location: Algeria
Posts: 5
Rep Power: 0
xiaotuanzi is on a distinguished road
That's good job.
__________________
flyff penya flyff gold flyffpenya
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Movie Clip not playing "correctly" in File... BushyMark Newbies 0 11-27-2006 09:20 PM
Simple Movie Clip Problem! Voltz General Flash 5 04-30-2005 01:38 AM
Playing specific frames of a movie clip MattaGe^ Actionscript 2.0 1 11-30-2004 03:16 PM
movie will not stop at selected frame Dynamic Fluids Flash MX 2004 3 11-12-2004 06:18 AM
preloading plankd Newbies 4 08-25-2000 11:15 AM




All times are GMT. The time now is 02:24 PM.