A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Creating A Dynamic Slideshow ?

  1. #1
    Member
    Join Date
    Jul 2003
    Location
    Lahore
    Posts
    92

    Creating A Dynamic Slideshow ?

    Hi I know how to load jpgs dynamically, All I want is to use loaded jpgs as a photo slideshow, using only two buttons (Next and Previous) So what code goes for those buttons ?
    Nemesis

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Name the jpg's sequentially. image1.jpg image2.jp and so on.

    On first keyframe.

    _root.i=0;

    //NEXT button
    on(release){
    _root.i++;
    container.loadMovie("image"+_root.i+".jpg");
    }

    //BACK button
    on(release){
    if(_root.i>1){
    _root.i--;
    container.loadMovie("image"+_root.i+".jpg");
    }
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Member
    Join Date
    Jul 2003
    Location
    Lahore
    Posts
    92
    Thanx dude, I hope this helps.
    Nemesis

  4. #4
    Member
    Join Date
    Jul 2003
    Location
    Lahore
    Posts
    92
    Thanx dude it's working fine but at the very last image it gives error image not found. I'm really noob to actionscripting so plz tell me how to correct it. Thanx
    Nemesis

  5. #5
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You can add a variable where you tell how many images there are.

    // On first frame
    _root.image_amount=5;

    ...and add to the NEXT button

    //NEXT button
    on(release){
    if(_root.image_amount<6){
    _root.i++;
    container.loadMovie("image"+_root.i+".jpg");
    }
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  6. #6
    Member
    Join Date
    Jul 2003
    Location
    Lahore
    Posts
    92
    OH Well working fine, But how can I use Progress bar component with those external jpgs ? Thanx
    Nemesis

  7. #7
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You can have the code ON the container clip itself too...something like....

    onClipEvent (enterFrame) {
    tb = math.round(this.getBytesTotal()/1024);
    lb = math.round(this.getBytesLoaded()/1024);
    perc = math.round((lb/tb)*100);
    if (lb>=tb) {
    _parent.loadBar._visible = 0;
    } else {
    _parent.perc = perc;
    _parent.loadBar._width = perc;
    _parent.loadBar._visible = 1;
    }
    }


    loadBar being a small movieclip on the main timeline.( or the same timeline the container clip is at ).

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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