dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Image traistion using Actionsscript

  1. #1
    Senior Member
    Join Date
    May 2002
    Posts
    132

    Image traistion using Actionsscript

    Hi all,

    I know this is a simple question and for the time that I have been usiong flash I should know the answer but what I have been trialling has not worked.

    I want to have several images that cross fade so it looks like as one image fades out the other is fading in thus creating a nice tranisition between images. now everyine knows how to do this with tweening but I want to do it so that it loads a jpeg into flash and then as it fades out it calls in another to fade up.


    Could anyone help me get started with the code needed to create something like this.

    I would be most grateful for any code help anyone on here can give me.

    Thanks Pixelmagik

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You can use 2 container clips on top of each other.
    The first picture is loaded in the top container mc, and the next pictures allways in the container below, once the first picture is at 100% alpha. If the pictures are all of the same size, then it's simply a question of fading out the top picture, giving the illusion of a dissolve, without having to really fade up the underlying one.
    If pictures are not of the same size, then as the top one fades out, you have the bottom one fade in.
    Once the fades are over, you use swapdepths to switch the bottom container as the top container, and load in the next picture, in the bottom container.

  3. #3
    Senior Member
    Join Date
    May 2002
    Posts
    132
    Thanks Old Newbie,

    I understand the concept and will have a go at the code but will be back to get help with some small code parts if I cant sort it out.

    I thought you were leaving us for a while Old Newbie.

    Pixelmagik

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    120
    hmm, I know an old thread

    But I am trying to get this to work. I got 8 movieclips on stage with each 3 different images. For each movieClip I want to have a fade in/out loop, furthermore each movieclip must start at a different time.

    So first I want to create a fade loop for 3 images.

    I am trying this:
    Code:
    navSuite = ["nav1A", "nav1B", "nav1C"];
    for (i=0; i<=navSuite.length; ) {
    	//i=0;
    	holderA_mc.attachMovie(navSuite[i], "part1", 1);
    	if (holderA_mc._alpha=100) {
    		i++;
    		holderB_mc.attachMovie(navSuite[i+1], "part2", 2);
    		//swapdepths
    	}
    }
    MovieClip.prototype.fadeOut = function(speed) {
    	this.onEnterFrame = function() {
    		this._alpha -= speed;
    		if (this._alpha<=0) {
    			this._alpha = 0;
    		}
    	};
    };
    holderA_mc.fadeOut(10);
    not working

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