A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: stacked picture gallery

  1. #1
    endless possibilities MadDog 555's Avatar
    Join Date
    Aug 2004
    planet earth

    stacked picture gallery

    i wanted to do something similar to this:


    i wanted to have an image gallery that has stacked images kinda like this.

    i want it so you can either be able to click on the thumbnail on the side of the stack of pictures or the actual pic.

    then the picture you click on moves to the top.

    how would i do that?
    any help would be greatly appriciated!


    endless possibilities

  2. #2
    All 1s and 0s dmonkey's Avatar
    Join Date
    Nov 2005
    Leeds, UK

    You'll probably be interested in the swapDepths() method. Basically you will want to do something like:

    myClip.onPress = function() {
    this.swapDepths(_parent.getNextHighestDepth() - 1);
    This will swap the clicked clip with the clip that is at the top. This will not preserve the order of the clips; you would have to write a bit more code to do that.

    Hope this helps.

  3. #3
    Getting There! bitsk308's Avatar
    Join Date
    Jul 2000
    Phoenix, AZ
    Hope this isn't too late to help. I went to figure the "extra code" to preserve the stacking order, and it ended up being a huge pain in my arse. I hate when that happens. Anyway, got it licked at longlast. Basically just a matter of keeping the clips in an array in the order of the stack. So any image you pick will get spliced out of the array, pushed back into at the end and then each clip has it's depth swapped to whatever index of the array it's in. Basic concept with one tricky bit. When you use push the spliced clip back on to the array you have to specify an element index of [0], since the return of the splice is a n array. Here's the fla if you want to take a look.

    Last edited by bitsk308; 01-10-2008 at 01:32 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center