A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: fade in fade out pictures with actionscript

  1. #1
    Member
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    43

    fade in fade out pictures with actionscript

    I need a actionscript for the following problem.

    load external *.jpgs with loadmovie in a movieclip. The picture fade in and fade out. Then the next picture will fade in and fade out.

    In Flash MX folder samples is a tutorial called load_images.fla This tutorial works with click on the button.

    What I want is that the movie play itself.

    ThanXS

  2. #2
    forever depreciated™ aaron.martone's Avatar
    Join Date
    Dec 2002
    Location
    Florida, USA
    Posts
    448
    lol.

    You sorta make it sound like we're all a buncha flash junkies here to accept requests for work on custom flash coding. I don't think many vets here will give the entire code; instead we try to inspire people to learn flash than just hand over the code.

    One needs to understand in order to become enlightened, my child. *gong plays*

    You should brainstorm out an idea on how a system like that works. To me, I would setup an array of jpeg sources, and then systematically run them through a function who's purpose is to alpha fade in, wait a couple seconds, and alpha fade out; then a little check to move the array to the next index (and a cross check to start back at the beginning if you were at the end of the array, and do it all over again.
    (am)™ :: aaron.martone ::
    http://www.aaronmartone.com

    "I see in layers; I think in ActionScript; Life is my animation and animation is my life.... oh, and I like corn dogs."

  3. #3
    Member
    Join Date
    Jan 2003
    Location
    The Netherlands
    Posts
    43

    Solution

    square._alpha = 0;
    whichPic = 1;
    _root.onEnterFrame = function() {
    if (square._alpha>2 && fadeOut) {
    square._alpha -=2;
    }
    if (square._alpha<2) {
    loadMovie("../images/image"+whichPic+".jpg", "square");
    fadeOut = false;
    fadeIn = true;
    whichPic++;
    }
    if (square._alpha<100 && fadeIn && !fadeOut) {
    square._alpha +=2;
    } else {
    if (whichPic>=6) {
    stop();
    } else {
    fadeOut = true;
    }
    }
    };

  4. #4
    Junior Member
    Join Date
    Apr 2009
    Posts
    3
    Hey do you now how to have the slideshow loop?


    Posts: 43

    Solution
    square._alpha = 0;
    whichPic = 1;
    _root.onEnterFrame = function() {
    if (square._alpha>2 && fadeOut) {
    square._alpha -=2;
    }
    if (square._alpha<2) {
    loadMovie("../images/image"+whichPic+".jpg", "square");
    fadeOut = false;
    fadeIn = true;
    whichPic++;
    }
    if (square._alpha<100 && fadeIn && !fadeOut) {
    square._alpha +=2;
    } else {
    if (whichPic>=6) {
    stop();
    } else {
    fadeOut = true;
    }
    }
    };

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