
Welcome Guest
|
#1
|
||||
|
||||
|
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 |
|
#2
|
||||
|
||||
|
Excellent tutorial there Paul
__________________
Twitter . |
|
#3
|
||||
|
||||
|
Quote:
__________________
.:To me AS is like LEGO, Only for the big Kids :. - Site - Blog - Glasgow Flasher - Activeden - bringmadeleinehome.com |
|
#4
|
|||
|
|||
|
Useful code.
|
|
#5
|
|||
|
|||
|
"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();
} |
|
#6
|
||||
|
||||
|
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 |
|
#7
|
||||
|
||||
|
Why check if _currentframe is less than frame 20 when going forward? You should check if _currentframe is less than _totalframes to keep things usable across any movieclip. See Play a movie in reverse
__________________
Our greatest glory is not in never falling but in rising everytime we fall. - Confucius Blog | Shared Items |
|
#8
|
|||
|
|||
|
I would edvise to take a look at http://www.greensock.com/. great tween class that gives you all the ways to go back and forward...
__________________
www.mitree.de |
|
#9
|
|||
|
|||
|
That's good job.
|
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |




Twitter

