|
-
I'm not afraid
Play until frame# then stop?
I'm working on a sort of flash "magazine" and I'm using two types of navigation. First is just a next button the flip the page which is simple. The second is a little more complicated.
I want to be able to flip forward to any page from the "table of contents", but I don't want to skip directly to it. I want each page to turn until I get to that point. (ie: from page 1 each corresponding page should flip through to get to page 11)I can't use the usual stop action because that would break at every page. So I was wondering if there is some actionscript to accomplish this.
Thanks,
Fearless
-
I would make the buttons define the desired page to be at:
on (release) {
desiredPage = 2; // or whatever
}
Then, have ano empty MC with the following code:
onClipEvent (enterFrame) {
if(_parent._currentframe < _parent.desiredPage){
_parent.gotoAndPlay(_parent._currentframe++);
}else{
_parent.stop();
}
}
This may make it awkward if you need to go backwards, and I guess you don't want to play your movie backwards, so add:
onClipEvent (enterFrame) {
if(_parent._currentframe < _parent.desiredPage){
_parent.gotoAndPlay(_parent._currentframe++);
}else if(_parent._currentframe > _parent.desiredPage){
_parent.gotoAndStop(_parent.desiredPage);
}else{
_parent.stop();
}
}
Of course, you could play it backwards if you wanted (_currentframe--)
[ + introspection - ]
FlashKit Featured Site
-
I'm not afraid
That worked awesome, but I actually do want to be able to run it backwards as well, I tried the currentframe-- but that just jumped to that frame instead of actually playing the movie backwards. Any Ideas?
Thanks Again,
Fearless
-
I dont think it is actually possible to play the movie backwards.
The best you can do is 'Reverse' the frames. You will find this option by selecting your frames, right clicking then selecting 'reverse frames'
[swf width="300" height="40" background="#000000"]http://www.zizunetwork.com/zizunetworkcouk.swf[/swf]
-
Oh yeah, didn't work for me either.....but this does:
onClipEvent (enterFrame) {
_parent.xx = _parent._currentframe;
if (_parent._currentframe<_parent.desiredPage) {
_parent.gotoAndPlay(_parent._currentframe++);
} else if (_parent._currentframe>_parent.desiredPage) {
_parent.gotoAndStop(_parent._currentframe-1);
} else {
_parent.stop();
}
}
[ + introspection - ]
FlashKit Featured Site
-
oh ignore the line:
_parent.xx = _parent._currentframe;
that was for my own testing purposes.
Here's all you need:
onClipEvent (enterFrame) {
if (_parent._currentframe<_parent.desiredPage) {
_parent.gotoAndPlay(_parent._currentframe++);
} else if (_parent._currentframe>_parent.desiredPage) {
_parent.gotoAndStop(_parent._currentframe-1);
} else {
_parent.stop();
}
}
[ + introspection - ]
FlashKit Featured Site
-
I'm not afraid
That worked great intro! Thanks a million.
-Fearless
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|