Clicky

I want to make a slideshow in flash where I can have forward and backward buttons on the right and left sides of the movie that make the slides go to the next but also have buttons along the bottom if the person already knows what photo they want to see. The best example I can think of showing is the taco bell site. Here: http://www.tacobell.com/food/burritos
on the burritos page they have the left and right arrows. I want that and I also like the action. I've done an action like that for a forward movement in the timeline but I don't know how to do it backwards when you press the back button. In addition to these side buttons, (on the taco bell page they have tacos, burritos, gorditas etc. on the bottom that go to other pages but I want these bottom icons to be the same images of the current slide show) I want the bottom icons to be clickable and go to their corresponding image in the slide show fashion. I hope I'm explaining this correctly.

I think the forward motion is your basic straight forward forward motion right? I like how theirs fades out rather quickly as it gets to the next image. But how do I do the backwards motion? And how do I do the action on the buttons to go backwards to say image 1 if they are on image 4? Oh and this is in actionscript 2.0. I haven't learned 3.0 yet and don't even know much of 2.0. Please help! I've been trying to figure this out for weeks. This is my last resort.

Thanks ahead of time.

asked 08/05/2011 12:53

rxyl81's gravatar image

rxyl81 ♦♦


10 Answers:
There are several good, free, open source flash slideshows that you can just plugin - from how you describe your level of experience, I think that might be your best bet.

Otherwise, what you're describing would be much easier to do with script, rather than a timeline animation.

The basic approach, how I'd do it (my AS2 is a little rusty, but I think that's probably true for everyone in the world at this point - you should really try to upgrade to 3)

First, put all your images in an array, e.g., var images = ["image1.jpg", "image2.jpg", "image3.jpg"];

Then create a variable to indicate which image is actively being show, e.g., var activeImage = 0;

Then create a function to handle changes to this number

function setImage(){
  // load up images[activeImage], place it off the stage, set it's _alpha to 0, tween the existing one out and the new one in
}

The next and previous arrows would just increment or decrement activeImage
nextArrow.onPress = function(){
  activeImage++;
  setImage();
}
prevArrow.onPress = function(){
  activeImage--;
  setImage();
}

obviously you'd need some controls to make sure the image didn't go past the total number or go below 0...

Next, for each item in the array, create a small icon underneath, spaced and sized appropriately.  You can use createEmptyMovieClip to create the containers, MovieClipLoader to load in the images, then add listeners for when the image has been loaded to size and position them.  Each of those icons gets a handler to set the active image to it's own position

var icon = iconContianer.createEmptyMovieClip(i, i);
// use a MovieClipLoader to load the image into the icon, and give it an "index" value
icon.index = i;
icon.onPress = function(){
  activeImage = this.i;
  setImage();
}

You can use the built-in Tween class to move the images in and out, or roll your own

import mx.transitions.Tween;
import mx.transitions.easing.*;
// the next line would move someMC to _x position 500 over 1 second, using strong inertia (fast at start, slow at end)
new Tween(someMC, "_x", Strong.easeOut, 500, 0, 1, true);


That's the basic idea - like I said, if you're not familiar enough with ActionScript to tween something, you might be better off using a pre-fab solution, but the general outline above should get you pointed in the right direction
link
moagrius's gravatar image

moagrius

I'd like to try what you suggest but if I can't get it to work, where would I be able to find these free slideshows you are mentioning?
link
rxyl81's gravatar image

rxyl81

a quick google of "flash slideshow" gave back several results...

http://flash-gallery.com/
http://www.flashxml.net/media-slideshow.html

you could try "flash slideshow" or "flash gallery" or "flash photo gallery", etc.
link
moagrius's gravatar image

moagrius

Also, the script you are describing sounds beyond my comprehension level. How would I do this with the timeline? I only have about 10 images. So even though it would take longer, I'm thinking it might be easier for me. Thanks for the actionscript 2.0 info as well, I don't think I will be learning any more of that and go straight to 3.0.
link
rxyl81's gravatar image

rxyl81

I only know how to add actionscript to frames or buttons. So I don't know where to even start with what you described. :(
link
rxyl81's gravatar image

rxyl81

i'm not sure you could do it with just frames - i think you'll need to learn actionscript.  start small - figure out how to create a textfield, write some text, and add it to the stage.  then figure out how to load an image.  then figure out how to change properties, then how to animate them.  at some point, you'll want to learn about OOP and class files, but you could do what you're describing in frame script.

some very breif basics (AS3).

create a new FLA.

click on Frame 1.

open the Actions panel.

paste the following:

var textfield:TextField = new TextField();  // create a textfield object
textfield.text = "howdy";  // write some text to it
this.addChild(textfield);  // add it to the display list

run Test Movie

Unfortunately, what you're describing isn't something I could write for you quickly.
link
moagrius's gravatar image

moagrius

The problem is that I already started this in the timeline and I did all the forward work for it. I don't have enough time to learn actionscript and post this by next week on thursday. I really thought if you can do forward tweening that maybe you could do backward tweening with an action in the frame or by clicking on a button. :(
link
rxyl81's gravatar image

rxyl81

you can use prevFrame, but I'm pretty confident you're not going to be able to achieve everything you want without a decent dose of scripting.

in AS2:

in the frame actions of the first frame of the timeline you're animating, you can use something like this

this.rewind=false;

this.onEnterFrame=function() {

if (this.rewind) {

this.prevFrame();

} else {

this.nextFrame();

}

}

then to rewind something, you just set the rewind variable to true...

rewindButtonMC.onPress = function(){
  yourAnimationInstance.rewind = true;
}
link
moagrius's gravatar image

moagrius

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:
Accept: moagrius (http:#36319060)

If you feel this question should be closed differently, post an objection and a moderator will read all objections and then close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

CyanBlue
Experts-Exchange Cleanup Volunteer
link
CyanBlue's gravatar image

CyanBlue

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
link
CyanBlue's gravatar image

CyanBlue

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×1
×34
×4

Asked: 08/05/2011 12:53

Seen: 287 times

Last updated: 10/16/2011 09:18