Play in Reverse
PLEASE LOOK AT MY NEWEST POST!!
Hello, I was wondering if someone could guide me a little
with playing a movie clip in reverse. The major problem I'm having,
though, is that I have a frame-by frame animation withing a movie
clip called 'card' of a card flipping over. Now 'card' itself is
also tweened to move to the left and change in size as it flips
over, and also has an independent drop shadow for effect. So I need
to have everything go in reverse; the frame-by frame within 'card',
as well as the right to left tween and drop shadow on the main
timeline.
My ultimate goal is to have the user click on the card, it
will flip over in one direction, click on it again, and it will
reverse and flip back to it's original position.
Thanks in advance for any help on this.
P
Well, I've decided to take a completely new approach.
I have reversed the frames in my movie clips, and I am far
closer to what I want to achieve. However, I still need to find a
way to remember if the card has flipped already, and when to flip
from frame 1.
Here are my files, please do have a look:
Fla
swf
I would still prefer to play in reverse, but I cannot figure
this out...
Cheers for any insight!
P
Similar Messages
-
Making movie clips play in reverse in AS 3.0
Hey all. I'm changing all my files to AS 3.0 because of some
new elements I'd like to use in flash CS4.
Here:
http://www.iaw-atlanta.com/IvyLeague1-13-09.html
I have the menu navigation at the bottom with 4 buttons. When the
buttons are moused over they ascend and when they are moused out
the movie plays in reverse so that they descend. Basically in the
movie clip, I have it stopped as well as gotoAndPlay the next frame
when the button is moused over and then have a script telling it to
reverse when moused out. I know how to do this in AS 2.0 but how
can I translate the script to 3.0?DjPhantasy5,
> Ok thanks, I'll see what he also has to say as well.
Actually, NedWebs pretty much nailed it. :) The approach
you've taken
is an interesting one, because it scales all the way back to
Flash Player 5,
which didn't yet support the MovieClip.onEnterFrame event.
Without that
event, you need something like your "controller" symbol -- a
separate
looping timeline -- to perform code that depends on frame
loops.
Available as of Flash Player 6, that event would allow you
to
consolidate your code a bit by putting it all in a single
frame and avoiding
the extra movie clip symbol. That doesn't mean your approach
is wrong, by
any stretch. In fact, it's good to know your options, because
if you ever
need to publish to Flash Player 5, you'll probably do best to
use the setup
you've taken.
I'll demonstrate onEnterFrame in just a bit, in case you
want to take a
look at that.
>> there's no _root reference in AS3, but you can use a
>> MovieClip(this.parent) (which replaces what _parent
>> used to do) to locate something outside of the
immediate
>> movieclip.
The term "parent," in this context, is technically a
property of the
MovieClip class, which means all movie clips in AS3 have
access to the
"parent" feature, which points to the timeline that contains
the movie clip
in question. Buttons also feature a "parent" property. In
AS2, this
property acted exactly the same, only it was preceeded by an
underscore.
In fact, NedWebs' suggested code works the same in your
existin file.
Instead of this:
// Your existing code ...
if (_root.animation._currentframe>1) {
_root.animation.prevFrame();
this.gotoAndPlay(2)
if (_root.animation._currentframe<=1) {
this.gotoAndStop(1);
... you could be using this:
// Alternative code ...
if (_parent.animation._currentframe>1) {
_parent.animation.prevFrame();
gotoAndPlay(2)
if (_parent.animation._currentframe<=1) {
gotoAndStop(1);
... because from this scope -- that is, from this point of
view -- the
MovieClip._parent property points to the same timeline that
_root does.
That changes, of course, based on how deeply nested the
current scope is.
The term "this" in the above code is optional, because Flash
understands
what scope you're in. From the point of view of this code,
_parent is
understood to refer to the current scope's parent timeline,
just like
gotoAndPlay() is understood to refer to the current scope's
own timeline.
You could precede either of those by "this" or not.
Many people will argue that _root is probably best avoided,
only because
it's a slippery slope. It doesn't always refer to the main
timeline you
think it does, depending on whether or not your SWF is loaded
into another
SWF at runtime. Meanwhile, _parent *always* refers to the
immediately
parent timeline.
So when you look at it that way, this perfectly valid AS2:
if (_parent.animation._currentframe>1) {
... isn't much different at all from its AS3 counterpart:
if (MovieClip(parent).animation.currentFrame>1) {
It would be nicer if you didn't need to cast the parent
reference as a
movie clip here, but if you don't, AS3 doesn't realize that
the scope in
question is a movie clip.
>> You can string them along as...
>> MovieClip(this.parent.parent)
Exactly.
>> Your _currentframe in the the controller becomes
>> currentFrame. That's about it. The rest of what I
>> saw will fly as is.
Not quite. AS3 doesn't support the on() or onClipEvent()
functions, so
you won't be able to attach your code direction to the
button. Instead,
you'll have to put it in a keyframe -- which you can also do
with AS2. It's
a good idea, in any case, because it allows you to put all
your code in one
place, making it easier to find.
Here's a quick note on direct attachment:
http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent
To convert your existing FLA structure to AS3, you might,
for example,
do this:
animation.buttonMode = true;
animation.addEventListener(MouseEvent.ROLL_OUT, outHandler);
animation.addEventListener(MouseEvent.ROLL_OVER,
overHandler);
function outHandler(evt:MouseEvent):void {
controller.gotoAndPlay(2);
function overHandler(evt:MouseEvent):void {
controller.gotoAndPlay(4);
That takes care of the on(rollout) and on(rollover) code in
your current
version. The first line (buttonMode) is only necessary
because I got rid of
the button symbol and, instead, associated the event handlers
directly with
your animation clip. (Movie clips handle button-style events,
too, so you
don't need the button.) In AS3, event handling is very
straightforward:
you reference the object (here, animation), invoke its
inherited
addEventListener() method, then pass in two parameters: a)
the event to
listen for, and b) the function to perform when that event
occurs.
You can see that spelled out above. In AS2, there are quite
a few ways
to handle events, including on()/onClipEvent(), so it's
harder to know when
to use what approach. For buttons and movie clips, the
princple works the
same as I just showed, but the syntax is different.
Let's take a quick look at reducing all this code by using
the
onEnterFrame event. First, check out this AS2 version:
animation.onRollOut = outHandler;
animation.onRollOver = overHandler;
function outHandler():Void {
this.onEnterFrame = reversePlay;
function overHandler():Void {
this.onEnterFrame = null;
this.play();
function reversePlay():Void {
this.prevFrame();
All of that code would appear in frame 1. You don't need the
controller
movie clip. The animation clip no longer contains an orb
button, because
we're using animation itself as the "button". (You can always
see what
functionality any object has by looking up its class. If
you're dealing
with a movie clip, look up the MovieClip class. See the
Properties heading
to find out what characteristics the object has, see Methods
to find out
what the object can do, and see Events to find out what the
object can react
to.)
In the above code, it's all laid out pretty easily. This is
AS2,
remember. We have two events we're listening for:
MovieClip.onRollOut and
MovieClip.onRollOver. Those events are established for the
animation movie
clip by way of its instance name, and associated with
corresponding custom
functions. The outHandler() function associates yet another
function to the
MovieClip.onEnterFrame event of the animation clip. Very
simply, it
instructs animation to perform the custom reversePlay()
function every time
it encounters an onEnterFrame event. The overHandler()
function kills that
association by nulling it out, and telling animation to play,
via the
MovieClip.play() method. Finally, the reversePlay() function
simply invokes
MovieClip.prevFrame() on the animation clip.
Here's the AS3 version:
animation.buttonMode = true;
animation.addEventListener(MouseEvent.ROLL_OUT, outHandler);
animation.addEventListener(MouseEvent.ROLL_OVER,
overHandler);
function outHandler(evt:MouseEvent):void {
animation.addEventListener(Event.ENTER_FRAME, reversePlay);
function overHandler(evt:MouseEvent):void {
animation.removeEventListener(Event.ENTER_FRAME,
reversePlay);
animation.play();
function reversePlay(evt:Event):void {
evt.target.prevFrame();
It looks wordier, but if you look carefully, you'll see that
it's
essentially the same thing. The main difference is the way
scope works in
AS3. In AS2, there are numerous references to "this", because
the event
handler functions operate in the same scope as the object to
which the
association is made. In AS3, the references aren't to "this",
but rather to
the same animation clip by its *intance name*, because in
AS3, the scope
operates in the same timeline in which the code appears
(namely, in this
case, the main timeline).
In the reversePlay() function, in order to emulate a "this"
sort of
setup, I'm referring to the parameter that gets passed to all
event handler
functions in AS3. I happened to name it "evt" (for event),
but you can call
it what you like. In the case of reversePlay(), the evt
parameter refers to
an instance of the Event class, which has a target property.
The target
property refers to the object that dispatched the event --
happens to be
animation, in this case. So evt.target, in this context,
refers to
animation, which is what I invoke the MovieClip.prevFrame()
method on.
I've uploaded a handful of FLA files to my server. I won't
keep them
there forever ... maybe a couple weeks, as of this post:
http://www.quip.net/RewindTestAS3.fla
http://www.quip.net/RewindTestAS3_new.fla
http://www.quip.net/RewindTestAS2_new.fla
David Stiller
Co-author, ActionScript 3.0 Quick Reference Guide
http://tinyurl.com/2s28a5
"Luck is the residue of good design." -
Making the main stage timeline play in reverse.
Hey all thanks for looking. I figured out how to do this with movie clips but I can't seem to get it right with the main stage. Can anyone tell me a simple methood of telling the stage to continue playing in reverse, after a button is clicked, until it reaches a keyframe that will tell it to stop? I'm trying to make it so buttons will tell the stage to play a transition from beginning to end and then have it play in reverse when the "back" button is pressed. I'm currently searching online to find an answer but I haven't had any luck yet. Thanks for the help!
KgIad -- tried to use this code but I am getting
TypeError: Error #2007: Parameter listener must be non-null.
Which appears to be caused by the changeTimelineF not being recognized. If I create it as
private function changeTimelineF(e:Event) {
if(startFrame<endFrame){
e.currentTarget.mc.nextFrame();
} else {
e.currentTarget.mc.prevFrame();
if(e.currentTarget.mc.currentFrame==e.currentTarget.endFrame){
e.currentTarget.removeEventListener(Event.ENTER_FRAME,changeTimelineF);
Then it is recognized--but the variables (e.g. startFrame and endFrame) are no longer valid.
What am I missing?
Thanks
Mike -
Getting a movie clip to play in reverse
I have this script to play a movie clip.
What do I write to get it play in reverse?
function fadeUp(event:MouseEvent):void {
buttonFadeOver_mc.play()You need to use an enterframe event listener to continuously call prevFrame() until you see that you have reached the starting frame (by checking the currentFrame property). Once you detect you are at the start you remove the event listener.
-
How do i have clips play in reverse
I need help! How do u make the clips in your movie play in reverse and the music play forward HELP!!!!!!!!!!!!!!!!!!!!!
'Search' is your friend..
read reply on same topic here..
http://discussions.apple.com/click.jspa?searchID=10830738&messageID=7320531
.. and please avoid double posts.. http://discussions.apple.com/thread.jspa?threadID=1550375&tstart=0 -
Hi All
I decided to make a Star Wars srolling title for my cousins birthday. Unfortunatley, it's playing in reverse. Any suggestions on how to flip it and how to add audio?
Thanks in advance
DeanWith the video in keynote:
Rewind movie (by frame if paused) J (hold down)
Pause or play movie K
Fast-forward movie (by frame if paused) L (hold down)
Jump to beginning of movie I
Jump to end of movie O
Look under the help menu/keyboard shortcuts in keynote for more shortcuts...
Also in keynote if you hold the cursor over the video...the video controls will appear (set this in keynote's preferences). -
Make a clip play in reverse?
I can't find it on the website...I have this SUPER funny fall of this person...why we all laugh at that?....WELL I want to have the person fall, and then all of a sudden he is played in reverse, and then fall again, etc, back and forth....
I know how to pause it, and slow motion it, mirror it, etc, but I want that reverse and back down again....I'm sure it is possible and easy???
Any insight would be GREATLY appreciated...and will post the youtube link as soon as I finish it!
Thanks,
Danwhen you have the clip selected in the sequence, take the razor blade tool and cut the clip at where you want the reverse to begin. then, delete the rest of the clip after it, and insert a copy of the clip that you want reversed. select the copy, then click Modify>Speed. when the window comes up, just check the "reverse" box, and click ok.
Hoped that helped. -
3D animation plays in reverse ?
I am trying to prepare a simple video of a book opening. You can see the file here:
https://docs.google.com/file/d/0B-cQQhdwl3C-b3JPYlM0SGZERnM/edit
If I scrub the timeline, the book opens as you would expect. However, when I test publish it, ir plays in reverse. Does anyone know why ? Incidentally, I put a stop action at the end to stop it looping. Any help would be greatly appreciated.
Regards,
TL.You can/should keep all your actionscript in one place whenever possible, and in your case I see no reason why you cannot have it all in the same frame/layer.
If you use the "cover" in that code, it is still trying to turn the cover. You can probably reuse that same function for all page turnings as well. Just change that function to be a little more generic and define the page that is to be turned....
var page:MovieClip;
function turnPage(evt:Event):void {
page.rotationY += 2; // adjust value for speed or change frame rate
if(page.rotationY == 180) stage.removeEventListener(Event.ENTER_FRAME, turnPage);
Then you can have a new function that you call that assigns page to be the new object and sets up the ...
function startTurning(pg:MovieClip): void {
page = pg;
stage.addEventListener(Event.ENTER_FRAME, turnPage); // this starts the turning
And when you want to turn a page you call that function with the object's name as an argument.
startTurning(cover);
start turning(leaf1);
startTurning(leaf2); -
A brand new problem! Please help me to find the culprit that created a wierd
intermittent freeze-ing when playing clips or sequences in reverse. Audio plays back properly, but pic doesn't.
Did this happen as a result of any software updates, maybe?did you try it with a clip on the startup drive?
i'm testing on a PowerBook G4 1GHz, OS X 10.4.2, 768MB RAM, FCP5.0.2 and a DV PAL clip on the internal drive ... plays forward and back with no problem, its all good .
there are RAM checking tools, but i doubt thats the problem ... if you had dodgy RAM then the chances are that you'd have seen more problems than just reverse play in FCP! but you try Micromat's Tech Tool Pro i think that may have a RAM check utility.
do you need this for live playback? smooth reverse playback has never been a showstopper for me can you scrub easily or is that sticking too? -
Click to play, and click to play in reverse actions with specific time
Is there any code that can specify the amount of time my animation will play forwards or in reverse so that the viewer can move my animation in set increments either forwards or backwards along the timeline. ?
i.e. 1 second forwards or one second in reverse.To play forward 1 sec do:
var t = sym.getPosition();
sym.play();
sym.stop(t + 1000);
Similarly, to play backward:
var t = sym.getPosition();
sym.playReverse();
sym.stop(t - 1000);
hth,
Vivekuma -
How do I export clip to play in reverse?
I have a short segment, in point to out point, that I would like to export to a stand alone quicktime movie that would play back to front, or, in reverse.
What is the best way to do this?
Is it just Modify>Speed. Check the reverse box?
TIA,
KenI don't have a copy of FCE here with me at this location to confirm, but if it's like FCP, you can make speed changes using the speed tool or by selecting the clip then hitting Command j and entering the value. Any value entered less than 100 would be slow motion. However, Final Cut's slow motion isn't always the best. Motion (part of Final Cut Studio) does a much better job with its 'Optical Flow' retiming.
But your are correct, the best slow motion is form cameras that can record higher than normal frames rates. For example, if you record at 100fps, then slow that down in post, the effect is very smooth.
-DH -
Make a Tween always play in reverse?
I'm using the native Tween class and have a several tweens which make a button, when clicked, fly up into the corner of the screen. Then some time later yoyo() that tween to bring the button back to where it started.
The problem is that we have a replay button that replays from certain points on the timeline.
I want that if on the "screen" (not flash screens just our term for the range of frames that correspond to the timeline between those certain replay points) the user clicks replay that the button will always play the tween backward, i.e., flyout from the upper corner back to the "start" point.
Since there is no reverse() method or playInReverse() the only choice seems to be yoyo(). And one would think that fforward() followed by a yoyo() would make it always play backward. But I can't make it seem to work.
So my question is, "Is there a way to ensure that a tween, regardless of how it last player or is still playing, can be made to go to the end and then play backwards?"
Thanks.I think you're right, Rothrock. What bothers me the most about using yoyo(); is that if you call it before the tween has ended, the new beginning position is the current position. That is the tween has effectively truncated off the ending bit, which it had not yet reached. And also, because it is just switching the beginning and end positions, the easing used is also backwards. If it originally eased in, then in reverse, it should be an ease out, but this is not the case.
If you are using a frame-based tween instead of by seconds, you might be able to make use of the prevFrame() method:
myTween.stop();
onEnterFrame = function(){
myTween.prevFrame();
if(myTween.position == 0){
trace("Reverse complete!");
delete onEnterFrame;
Of course you could also use a setInterval if you don't want to involve using a MovieClip's onEnterFrame event handler. But anyway, I think this method is nice because you are essentially scrubbing the Tween like a timeline, preserving all of its properties, including the easing. -
How do I have the same clip playing in reverse and forwards
So essentially when I try to reverse one clip of two of the same clips it reverses both of them instead of just the one I selected. I've tried renaming it too and it didn't work. Thanks so much for your answers!
This happens because multitrack mode in Audition is essentially a very posh file player. If you have a file that plays in one direction, then it's simply not possible for the same file to play backwards at the same time - the engine can't do that! When you think you're playing two separate clips, you almost certainly aren't - this is just two playback instances of essentially the same file/clip.
There is a simple solution though; create a second (physically unique) copy of the clip and place that as the reversed one. Then you can have one clip playing in one direction, and the other clip playing in the opposite one. -
Possible to play video reverse
Hey I got a little problem I hope someone can help me with. I Have some small videoes I have to play on a seamless loop. It's basicly a little peace of video that i then play backwards so it appears like a seamless loop. At the moment I have made the video so it plays backwards, but I was hoping to cut that out to have some actionscript that would do that so i becomes a bit easier on the bandwith. Below, you can see the code I have sofar, hope you can help - thanks...
var moviesA2:Array =["videos/eyes1.f4v", "videos/eyes2.f4v"];
var movie2:String = moviesA2[Math.floor(Math.random()*moviesA2.length)];
var timedelay2:Number = 0;
var video2;
var nc2:NetConnection;
var ns2:NetStream;
nc2 = new NetConnection();
nc2.connect(null);
ns2 = new NetStream(nc2);
ns2.client = this;
ns2.addEventListener(NetStatusEvent.NET_STATUS,netStatusf2);
function netStatusf2(e:NetStatusEvent) {
if (e.info.code == "NetStream.Play.Stop" && Math.abs(durationNum-ns2.time)<.1) {
setTimeout(replayF2,timedelay2*1000);
function replayF2(){
ns2.play(movie2);
video2 = new Video(287,263);
video2.x = 284.1;
video2.y = 140.5;
addChild(video2);
video2.attachNetStream(ns2);
ns2.play(movie2);you can't play a video "smoothly" in reverse with actionscript. if choppy playback is acceptable, you can use the seek() method to playbackwards at about 1/2 to 1/4 second intervals.
-
Ipod shuffle plays in reverse when restarted
Ican play my Ipod shuffle in shuffle mode for an Hour today and when I play it again tomorrow in shuffle mode it will play the same songs from where I left it but in reverse order. So even though I have 8 hrs of tunes stored I effectively only hear the same songs over and over again .
Any advice.I have found another disadvantage to using Dopi.
I've had times when a podcast doesn't get downloaded fully: after downloading an episode of an hour-long program the podcast shows up in iTunes as being just, say, 23 minutes long. Normally you could delete that episode, click the right-pointing arrow in the line with the name of the show (NOT the line for the episode) to bring up the show in the iTunes store, and download the episode again (and again, and again, sometimes).
If an episode doesn't download properly in Dopi, clicking on that arrow in the show name's line brings up the show's website, and often you cannot simply get a particular episode of the podcast from that website.
This is not so much a complaint about Dopi -- not much they can do about it, I reckon -- but about the fact that we need something like Dopi at all. Feh.
For me, it is only "Talk of the Nation - Science Friday" that I want in order, as they break up the two-hour show into segments (convenient, yet not so for the Shuffle) and often talk about what's been said in a previous segment, which for me comes later. I've dropped Dopi and now I either load just one segment of Science Friday with a few other shows, or I load all the segments and mutter under my breath when I hear references to a previous segment I'll not hear until after the current one.
Maybe you are looking for
-
when I click to open the internet through Mozilla Firefox, I get this message; "The application failed to initialize properly (0xc0000006). Click on OK to terminate the application." When I do this, I have to click on it twice before the box goes awa
-
How to access images in a jar file
Hello, I am currently developping a swing application that uses icons (gif files) and I have zipped all my classes and images in a single .jar file. When I try to access those files it doesn't work ... it seems that I am not using the right way ... C
-
1.) How do you find the dictionary in Apple Mail Program? 2.) How do you add another dictionary?
-
Hey anyone able to get there iphone 3Gs to support video out to there tv. I hooked up my av cable that I have been using with my 3G but now will not work with my 3Gs. I get sound but no video. Anyone have this working?
-
My Mac Turns on But it Wont Load
I got a prompt for an update last night. So I updated it as I always do and it restarted but it never loaded up. It turned on and I just got a blank screen, I was REALLY tired and while I was 'giving it time' I fell asleep and woke up 3 hours later t