|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Rewind/Reverse Play in Flash
hey,
so far, i have created a movie which contains another movie from an external .swf file. i am trying to set up some playback controls for this embedded movie and so far have only implemented the play and pause buttons with the code 'submovie.play()' and 'submovie.stop()' respectively. is there any way, in which the submovie can be played in reverse at the current framerate when the 'rewind' button is pressed? thanks |
|
#2
|
|||
|
|||
|
Hi,
You could do it by having a new empty movie. Call it "rewinder". In the first frames actions enter: if(_parent._currentframe != 1) { _parent.gotoAndPlay(_parent.prevFrame()); } else { _parent.gotoAndPlay(_parent._totalframes); } and in the second frame enter: gotoAndPlay(1); Now place this movie on the timeline which you want to play in reverse. This can be activated by a button calling: rewinder.gotoAndPlay(1); and deactivated by calling: rewinder.gotoAndStop(1); This avoids having for() loops etc and allows you to control when to stop rewinding. In the above I made it loop back to the last frame when it reaches the start. Hope this helps. If it doesnt maybe I can make a short fla for you to demo it out. -Tann |
|
#3
|
||||
|
||||
|
thanks for your help, it works a treat ... it's just a shame the client doesn't need it anymore. i tried it out and works fine. i will be using it in the future for other projects.
thanks tann goran (GoMo) |
|
#4
|
|||
|
|||
|
reverse play
I have a movie tween setup, that only gets played with a rollover, i want the movie to reverse play to frame 1 when the user scrolls out of the setup area, i've attempted to implement the following code the movie starts at frame 2, so it should continualy go backwards until frame 1. menutween is the name of the movie clip
menutween.onRollOut = function() { if(_parent._currentframe != 1) { _parent.gotoAndPlay(_parent.prevFrame()); } }; also tried this: menutween.onRollOut = function() { if(_root._currentframe != 1) { _root.gotoAndPlay(_root.prevFrame()); } }; and this: if(rewinding) { _root.gotoAndPlay(_root.prevFrame()); } _root.menutween.onRollOut = function() { rewinding=true; }; the starting frame sets the value of rewinding to false. any suggestions? or how can i do this, or if you need me to post my fla please let me know. Last edited by lapidus : February 9th, 2004 at 01:15 AM. |
|
#5
|
|||
|
|||
|
Hi:
Code:
function rewindNow()
{
if(_root._currentframe != 1)
{
_root.gotoAndPlay(_root.prevFrame());
}
else
{
clearInterval(rewinderIntV);
}
}
_root.menutween.onRollOut = function()
{
rewinderIntV = setInterval(rewindNow, 1);
};
You could swap the setInterval stuff in favor of onEnterFrame, you can use your rewind = true/false var in place of set interval and clear interval...well hope you get the idea :¬) |
|
#6
|
|||
|
|||
|
ok i tried to implement what you said but i want it to be a reverse play ability, rather when i changed it would instantainiously go back to scene 1 so i attempted the following and it's still not working, i looked up the set interval function and the syntax for it is (functionname, x) where x is time rate, 1000 = 1 second, i changed the 1 to 1000 and it still went back to frame 1 the thing is, the thing that's rewinding is a tween so i'm not sure if that makes a differece, any way i changed it to this: and it's still not working, it's just going right back to frame 1, any help very much appreciated let me know if you need me to upload the fla
contents of frame 1 function rewindNow(object) { if(_root._currentframe != 1) { object.onEnterFrame = function() { if (_root.currentframe != 1) { _root.gotoAndStop(_root.prevFrame()); } } } else { clearInterval(rewinderIntV); } } menu.onRollOver = function() { gotoAndPlay(2); }; stop(); contents of frame 2-80: _root.menutween.onRollOut = function() { rewinderIntV = setInterval(rewindNow(_root.menutween), 1500); }; |
|
#7
|
|||
|
|||
|
Hi, could you post your .fla as a zipped attachement. I need to see this for myself...sorry.. :¬)
ps..needs to be in MX or earlier for me, cant read MX2004 files. You should be able to backsave with 2004. |
|
#8
|
|||
|
|||
|
thank you for the help
here it is:
|
|
#9
|
|||
|
|||
|
Hi, it's pretty tough when you have it set up as you do. I dont think it will work in your current configuration. It would be easier if you had the same instance in the last keyframe instead of a seperate movie. Why dont you just make it one big movie instead of having three seperate ones? That would make the code a synch to plugin.
|
|
#10
|
|||
|
|||
|
reverse frames in flash
I have a number of different images over a timeline; they all move from right to left over the stage, so as to appear to be on a "film".
The idea is that I have a couple of different buttons, and they will "move" you to a different section of that "film" so it looks like it is forwarding and rewinding the "film". I can do the forward no problem, I simply put stop actions in and then "play"; but how do I go in reverse? pleez hulp ![]() |
|
#11
|
|||
|
|||
|
Hi, you can do that by using the buttons to set a variable in the film movie. Let's call it "forward" for now. So on the forward button we would have:
Code:
on(Release)
{
forward = true;
}
and on the backward button: Code:
on(Release)
{
forward = false;
}
Then on each keyframe where you currently have the stop() action replace that with: Code:
if(forward)
{
// You should only use either play() or gotoAndStop() below
// If it just plays forward continuously
play();
// If it's frame by frame
gotoAndStop(nextFrame());
}
else
{
// Again you should only use one of the following
// If it just plays backwards continuously
gotoAndPlay(prevFrame());
// If it's frame by frame
gotoAndStop(prevFrame());
}
Last edited by Tann San : February 24th, 2004 at 01:23 PM. |
|
#12
|
|||
|
|||
|
Hi there, thanks so much for your help.
The code looks good, and I cant understand why its not working for me, Ive attached my try file, could you have a look? Thank you very much |
|
#13
|
|||
|
|||
|
Hi, here it is. I used setInterval instead along with updateAfterEvent(). My other longer answer was a bit off. I thought you had say 20 keyframes next to each other. It wouldnt work with the setup you had.
|