A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] SwapDepth, setTimeout, fade

  1. #1
    Member
    Join Date
    Jul 2008
    Posts
    73

    resolved [RESOLVED] SwapDepth, setTimeout, fade

    What have I done wrong here? I need a movieClip to fade out, pause, then a new movieClip to fade in.

    Code:
    fullPreloader.onLoadComplete = function() {
    		load_01._visible = false;
    		
    		
    		if (j == 1) {
    			target_MC._alpha = 0;
    			var fadeOut1:Tween = new Tween(fullImage_mc1, "_alpha", Linear.easeIn, 100, 0, 0.5, true);
    			fadeOut.onMotionFinished = function() {
    					setTimeout(display, 350);
    					function display() {
    						fullImage_mc2.swapDepths(target_MC);
    						var fadeIn:Tween = new Tween(target_MC, "_alpha", Linear.easeIn, 0, 100, 0.5, true);
    					}
    			}
    		} else {
    			target_MC._alpha = 0;
    			var fadeOut2:Tween = new Tween(fullImage_mc1, "_alpha", Linear.easeIn, 100, 0, 0.5, true);
    			fadeOut.onMotionFinished = function() {
    					setTimeout(display, 350);
    					function display() {
    						 fullImage_mc2.swapDepths(fullImage_mc1);
    						 var fadeIn2:Tween = new Tween(target_MC, "_alpha", Linear.easeIn, 0, 100, 0.5, true);
    					}
    			}
    		}
    What I've tried to do is to set the target_MC alpha to 0 and fade out the current mc. Then when the fadeOut has completed to setTimeOut. After this the mcs will swapDepths and the target_MC should fade up to alpha = 0.

    I've attached the flash and xml files. The images were too large.
    Last edited by Playdoe; 01-19-2010 at 11:59 PM.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    fullPreloader.onLoadComplete = function() {
    	load_01._visible = false;
    	if (j == 1) {
    		target_MC._alpha = 0;
    		var fadeOut1:Tween = new Tween(fullImage_mc1, "_alpha", Linear.easeIn, 100, 0, 0.5, true);
    		fadeOut1.onMotionFinished = function() {
    			setTimeout(display,850);
    			function display() {
    				var fadeIn:Tween = new Tween(target_MC, "_alpha", Linear.easeIn, 0, 100, 0.5, true);
    			}
    		};
    	} else {
    		target_MC._alpha = 0;
    		var fadeOut2:Tween = new Tween(fullImage_mc2, "_alpha", Linear.easeIn, 100, 0, 0.5, true);
    		fadeOut2.onMotionFinished = function() {
    			setTimeout(display2,850);
    			function display2() {
    				var fadeIn2:Tween = new Tween(target_MC, "_alpha", Linear.easeIn, 0, 100, 0.5, true);
    			}
    		};
    	}
    };

  3. #3
    Member
    Join Date
    Jul 2008
    Posts
    73
    You sir, are a legend! Finally it works. Would you be able to help with changing the thumbnails alpha? I need the thumbnail to stay at alpha 100% when it is released. At the moment it goes back to 50%. I started a thread here http://board.flashkit.com/board/showthread.php?t=808546

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