View Full Version : rewind/ play frames backwards?
jondj24
October 10th, 2003, 09:04 AM
i have 4 main sections of my site and i would like it if the user is deep into section 2 and wants to click a button to go to section 3, section 2 actually reverses every tween/action it has ( breaking down ) then goes to section 3. i would prefer this rather than an abrupt shutdown section 2 and section 3 starts.
how is that possible?
example of what i am talking about :
www.attik.com
thanks.
jonathan
norie
October 10th, 2003, 01:34 PM
hopefully this will be suffcient:
Maizoon
October 10th, 2003, 02:15 PM
Unexpected file type?
norie
October 10th, 2003, 02:30 PM
sorry forgot i was using MX2k4
jondj24
October 10th, 2003, 03:51 PM
thanks for the .fla
but how can i apply this to a button that is loading an external .swf?
so when that button is pressed, the external movie runs backwards and then unloads too.
jonathan
jeremy*
October 10th, 2003, 06:09 PM
ok, using that file.
1. put a button on a new layer.
2. give it these actions.
on (release) {
var playback = true;
}
3. open the code for the function on the last frame.
add this to it.
if (playback == true) {....don't forget the closing bracket aswell.
so now it looks like this.
stop();
onEnterFrame = function () {
if (_currentframe != 1) {
if (playback == true) {
_root.prevFrame();
}
} else {
delete onEnterFrame;
play();
}
};
4. then add this to the first frame of the movie.
var playback = false;
-----
I'm sure there is a better way to accomplish this, but this works.
norie
October 10th, 2003, 06:59 PM
just a little tidbit:
if(statement){
}
is the same as
if(statement==true){
}
same goes for:
if(!statement){
}
is the same as
if(statement!=false){
}
jondj24
October 10th, 2003, 07:15 PM
ok, i did everything you said...i think it works but the problem i have now is that the shape tween doesn't stop after it reverses it's tween, it loops again.
i attached it, to this file.
on another subject:
how would i accomplish this reversal method, if the tween is from an external .swf? the button in the current .fla would have contain some kind of unloadMovie() as well.
jeremy*
October 10th, 2003, 10:15 PM
Originally posted by norie
just a little tidbit:......
Thanks for mentioning that, I thought about coding it like that, but when you are staring out with AS, sometimes it is easier to understand unfamiliar code, when you actually see "==false" and "==true". It makes it easier to visualize what the code is doing because it reads like english would. I wasn't going for the most l337 way to code it, I was going for the easiest to understand.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.