Flash Gallery | Flash Templates | Flash Menu | Flash Design | Flash Audio & Video

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Results 1 to 8 of 8

Thread: transition Fade

  1. #1
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,452
    Rep Power
    8

    transition Fade

    amazing Flash templates

    I created a simple image gallery slideshow that demonstrates how to use the Fade class of Flash transitions.


    The Fade class fades the movie clip object in or out. This effect requires no additional parameters.


    I imported 12 images in the library of Flash, I assigned to each of them a class to "attack" from the library to the Stage with Actionscript.

    Then, using a timer and classes TransitionManager and Fade, I created the image gallery.









    The code I used:


    Code:
    package
    {
    	import flash.display.*;
    	import flash.text.*;
    	import flash.events.*;
    	import flash.utils.*;
    	import fl.transitions.*;
    	import fl.transitions.easing.*
    	
    	public class Main extends MovieClip
    	{
    		private var image_classes:Array;
    		
    		private var timer:Timer;
    		
    		private var holder_mc:MovieClip;
    		
    		private const SPEED:int=3;
    		
    		private var boo:Boolean=true;
    		
    		private var id:int=0;
    		
    		public function Main()
    		{
    			addEventListener(Event.ADDED_TO_STAGE,init);
    		}
    		
    		private function init(evt:Event):void
    		{
    			removeEventListener(Event.ADDED_TO_STAGE,init);
    			
    			image_classes=new Array("Caustic","Condensed","Dewdrop","Division","Frozen","Fusion",
    									"FusionBlue","GoingUp","Jacks","Magma","Marine","Photosynthesis");
    			
    			createHolder();
    			displayImage();
    		}
    		
    		private function createHolder():void
    		{
    			holder_mc=new MovieClip();
    			addChild(holder_mc);
    		}
    		
    		private function displayImage():void
    		{
    			if(holder_mc.numChildren>0)
    			{
    				var bitmap:Bitmap=holder_mc.getChildAt(0) as Bitmap;
    				holder_mc.removeChild(bitmap);
    			}
    			var image_class:Class=Class(getDefinitionByName(image_classes[id]));
    			var imgData:BitmapData=new image_class(0,0);
    			var img:Bitmap=new Bitmap(imgData);
    			img.x=stage.stageWidth/2-img.width/2;
    			img.y=stage.stageHeight/2-img.height/2;
    			holder_mc.addChild(img);
    			
    			TransitionManager.start(holder_mc,{type:Fade, direction:Transition.IN,
    			duration:1,easing:None.easeNone});
    			startDisplayTimer();
    		}
    		
    		private function hideImage(evt:TimerEvent):void
    		{
    			TransitionManager.start(holder_mc,{type:Fade, direction:Transition.OUT,
    			duration:1,easing:None.easeNone});
    			startHideTimer();
    		}
    		
    		private function startDisplayTimer():void
    		{
    			if(timer!=null)
    				timer.reset();
    			timer=new Timer(SPEED*1000,1);
    			timer.addEventListener(TimerEvent.TIMER,hideImage);
    			timer.start();
    		}
    		
    		private function startHideTimer():void
    		{
    			if(timer!=null)
    				timer.reset();
    			timer=new Timer(1000,1);
    			timer.addEventListener(TimerEvent.TIMER,callDisplayImage);
    			timer.start();
    		}
    		
    		private function callDisplayImage(evt:TimerEvent):void
    		{
    			id++;
    			if(id>image_classes.length-1)
    				id=0;
    			displayImage();
    		}
    	}
    }
    Attached Files

  2. #2
    Junior Member Settled In victorcharles is on a distinguished road
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    Re: transition Fade

    I don't see any "fade" effect in the example on this page- only the blinds transition.

  3. #3

  4. #4
    Junior Member Settled In grigoriii is on a distinguished road
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Re: transition Fade

    hi,
    how can I make this effect with my own photos.

  5. #5
    Moderator Moving My Stuff To The FlepStudio OrientExpress is on a distinguished road OrientExpress's Avatar
    Join Date
    Aug 2009
    Posts
    1,279
    Rep Power
    2

    Re: transition Fade

    Hi,
    change the photos in library with yours and be sure they have the same Class names in property panel of each photo.

  6. #6
    Junior Member Settled In grigoriii is on a distinguished road
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Re: transition Fade

    hi,
    thanks awfully for replay.

    I have one more question. It is possibe to mix more transition effects on this images for examlpe: for each of this photos make a different transition effect (fade, iris, squezze, photo, wipe, etc.)

    How make this effect, workable, and thanks a lot for replay.

  7. #7
    Moderator Moving My Stuff To The FlepStudio OrientExpress is on a distinguished road OrientExpress's Avatar
    Join Date
    Aug 2009
    Posts
    1,279
    Rep Power
    2

    Re: transition Fade

    I will suggest your feedback to Flep

  8. #8
    Junior Member Settled In ROBOTINAH is on a distinguished road
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Re: transition Fade

    Is theres away that i can add an url to this?

+ Reply to Thread

Similar Threads

  1. transizione Fade
    By Flep in forum Articoli e tutorials
    Replies: 12
    Last Post: 3 Weeks Ago, 20:10
  2. loader immagini + fade
    By sminobs in forum Actionscript 3.0 avanzato
    Replies: 7
    Last Post: 08-02-10, 16:59
  3. Info su semplice fade in fade out in as3
    By pinetto in forum Flash CS3 Design
    Replies: 1
    Last Post: 06-11-09, 07:46
  4. Audio Fade Out
    By raziel in forum Flash Italiano
    Replies: 2
    Last Post: 10-05-08, 19:53
  5. css flash fade & c.
    By nootropic.kint in forum CSS | HTML
    Replies: 1
    Last Post: 12-12-07, 21:29

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Optimization by vBSEO