Flash next/prev navigation
- Started
- Last post
- 19 Responses
- frankosonik
The best solution gets a $20 Amazon gift certificate:
I'm making a Flash slide presentation, but I'm not using the crappy presentation features of FlashMX Pro 2004.
I need to know if I'm developing the next/previous buttons in the most efficient way:
I have all slides inside individual movie clips with a stop action in the first frame. There's a separate clip for the next/prev buttons. I've declared a _global variable and I'm using the AS code below to determine which frame should be played:
fwd = function() {
if (_global.nav == "1_a") { // slide 1, label a
this._parent.slide1.gotoAndPlay... // slide 1 label b} else if (_global.nav == "1_b") { // slide 2, label a
this._parent.slide2.gotoAndPlay... // start slide 2
this._parent.slide1.gotoAndStop... // remove slide 1}
Those are just the next functions, the previous function is similar.
It's kindof working, but it seems to get messed up during playback. I have an .fla to post, if interested.
- unfittoprint0
what you should is make a slide function and use an interval to loop it when necessary.
Create a refresh function that has the number of images inside. That will slide and, when necessary, disable the fwd or rwd button when the slide reaches the beginning or the end. The refresh should have a parameter/number that indicates where to go.
ie.
total=10;
count=1;
refresh = function(n){
slide(n);
count=n;
rwd._visible=(n==1)?false:true
fwd._visible=(n==10)?false:true;
}fwd = function(){
refresh(++count)
}rwd = function{
refresh(--count)
}//start
refresh(1);
- JazX0
frank, E-mail me I have something you might like to see and actually I am working in the same field, but putting .flv video files in slide apps. Much like MediaSite and Tegrity but developed in Flash. Fun stuff.
- frankosonik0
Thanks, unfit. I'm a bit unclear as to how this would work. Is there an example I can look at somewhere?
- JazX0
frank, I've e-mailed you, but give the certificate to unfit.
- frankosonik0
Jason,
That sounds interesting, but it's a bit different from what was being done on this project. The client wanted a presentation that didn't look like PPT, so they hired me to design one in Flash. Lots of animation effects, etc.
- frankosonik0
"Create a refresh function that has the number of images inside."
When you say "number of images," what are you referring to?
Sorry if this is a dumb question.
- unfittoprint0
//make an MC with all the images and place them in the stage.
imageSize = 200;
totalImages=10;//slide function
changePos = function(targetx){
slideMC += (targerx-SlideMC._x)/4
}
slide = function(targetx){
clearInterval(slideLoop);
slideLoop=setnterval(this, "changePos", 30, targetx);
}//refresh function for the buttons
refresh = function(n){
slide(n*imageSize);
count=n;
rwd._visible=(n==1)? false:true
fwd._visible=(n==totalImages) ?false:true;
}//button functions
//these buttons are MC'sfwd = function(){
refresh(++count)
}rwd = function{
refresh(--count)
}//initiate
refresh(1);
- frankosonik0
Thanks again, unfit.
I apologize for not being clear, but there are no "images" in the slide presentation. There are a series of movie clips with graphs, charts, outlines, etc. I've uploaded the files here for you to look at:
http://www.finishbyfriday.com/sl…
Please send me your contact info so I can email you this gift cert.
Thanks again for all your help.
- frankosonik0
Unfit: each slide in the .swf advances with the right arrow key.
- JazX0
Frank, you know that you can export out of Powerpoint as .wmf and use those as vectors within Flash right?
- JazX0
I got you, but theoretically, you could use the slideshow that I've built for the same thing, from graphic to graphic or .swf to .swf. It's just a target thing.
- frankosonik0
Yes, Jason. The problem is all the graphics that the client made in PPT were so crappy that they needed to be recreated.
thanks
- JazX0
yeah that's typical, I got you. Anyway if you want a download link to what I did, cannot hurt, it's just large
- unfittoprint0
I wrote images, but they could also be MC's.
That's a standard and scalable way to make a slide presentation.
My help is PVN only, but since I'm on a good mood, I'll have a look. But later.
- JazX0
yeah like if you are making them in Flash then also vector-based MCs. If you are stuck with the clients crap work in PPT then use the .wmf method of importing, etc.
- wbcd0
if you need a visually pleasing way to do this with nice image transitions and rollovers etc I can help you out.
- frankosonik0
Here's what I've got:
A flash presentation that "advances/goes to previous" with a keystroke (left/right) arrow keys.
Here's what I need:
The same presentation to "advance/gotoprevious" by clicking a movieclip or graphic on the stage.I know I can go a put a bunch of tell targets on each mc timeline, but I'm just looking for the most efficient way to do it. That's why I started using the _global variable, but I'm probably still missing something because it tends to hiccup when going back then forward.
- JazX0
I got ya', well you could do it linearly like you are suggesting or you could do it within a main movie and submovies, etc.
- wbcd0
yo just email me, ill show you how to do it, with an example.