A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [F8] Help with slideshow transitions in AS 2.0

  1. #1
    Member
    Join Date
    Apr 2008
    Posts
    63

    [F8] Help with slideshow transitions in AS 2.0

    So I've been following some tutorials trying to make a slideshow for a portfolio site, however, I've kind of lost my way. Basically, what I have so far is a script that draws my images in at runtime and then contains 2 simple buttons that allow the user to move forward and back. There's also a preloader in there for each image load.
    So the problem is, since I'm still relatively new to Flash, and because I was following a tutorial, I don't really know how to make my images fade in and out as the user clicks the 'next' and 'previous' buttons for a smoother transition.
    I'm pasting the script here, if anyone has any suggestions or advice, I would greatly appreciate it. Thanks in advance for any help!

    this.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
    this.createEmptyMovieClip("buttons_mc", this.getNextHighestDepth());
    this.attachMovie("loader","loader_mc",this.getNext HighestDepth());
    loader_mc._x = (Stage.width - loader_mc._width)/2;
    loader_mc._y = (Stage.height - loader_mc._height)/2;

    var myMCL:MovieClipLoader = new MovieClipLoader();
    var myListener:Object = new Object();
    myMCL.addListener(myListener);

    myListener.onLoadProgress = function(target,bytesLoaded,bytesTotal) {
    loader_mc._alpha = 100;
    var pct = Math.round(bytesLoaded/bytesTotal*100);
    loader_mc.bar_mc._xscale = pct;
    }

    myListener.onLoadComplete = function(target) {
    loader_mc._alpha = 0;
    }


    buttons_mc.attachMovie("prev_btn","prev_btn1",butt ons_mc.getNextHighestDepth());
    buttons_mc.attachMovie("next_btn","next_btn1",butt ons_mc.getNextHighestDepth());
    buttons_mc.next_btn1._x = Stage.width - buttons_mc.next_btn1._width - 10;
    buttons_mc.next_btn1._y = 10;
    buttons_mc.prev_btn1._x = 10;
    buttons_mc.prev_btn1._y = 10;

    var numPics:Number = 3;
    var picArray:Array = new Array();
    var currentElement:Number = 0;

    for (i=0;i < numPics;i++) {
    var location:String = "print ads/image0" + (i+1) + ".jpg";
    picArray.push(location);
    }



    myMCL.loadClip(picArray[currentElement],container_mc);

    buttons_mc.next_btn1.onRelease = function() {
    if (currentElement < picArray.length-1) {
    currentElement++;
    }
    else
    {
    currentElement = 0;
    }
    myMCL.loadClip(picArray[currentElement],container_mc);
    }

    buttons_mc.prev_btn1.onRelease = function() {
    if (currentElement > 0) {
    currentElement--;
    }
    else
    {
    currentElement = picArray.length-1;
    }
    myMCL.loadClip(picArray[currentElement],container_mc);
    }

  2. #2
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    do you want something similar to this?
    http://www.keithborders.com/crossfaderIV.html

  3. #3
    Member
    Join Date
    Apr 2008
    Posts
    63
    oh man, that is cool. i would love to do something like that, especially with the background turned on.

  4. #4
    Member
    Join Date
    Apr 2008
    Posts
    63
    EQFlash, do you know where I might be able to find somewhere that will help me achieve that effect? Thanks

  5. #5
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    i'll send you the script in a private message. that particular gallery preloads all the images prior to showing the gallery. Since images preload faster than video or audio, i prefer to preload all the pix first, at one time. but they can be individually preloaded.

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Why not share with the community?

    gparis

  7. #7
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    i have no problem with that. http://www.keithborders.com/crossfaderIV.html
    http://www.keithborders.com/FlashSam...mageArray.html
    these are the two links i was showing ctate76, as per the question. My appologies.

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