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

flash page flip

Actionscript 3.0 video tutorials

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 23

Thread: Fullscreen background images rotation

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

    Fullscreen background images rotation

    flash templates

    This free utility is a Flash fullscreen background (100%) which displays the images in rotation.

    Manageable from an external XML file, it loads external images and display them with a "stripes" effect.

    Minimum requirements are as usual Flash CS3 or higher, Actionscript 3.0 and Flash Player 9 or higher.


    CLICK HERE VIEW DEMO


    Included files



    • main.fla

    • package com.flepstudio

    • images folder

    • file xml/config.xml

    • package tween caurina


    Source files:
    Attached Files

  2. #2
    Junior Member Settled In uacomp is on a distinguished road
    Join Date
    Nov 2007
    Posts
    16
    Rep Power
    0

    Re: Fullscreen background images rotation

    thank you, flep. it is very simple but very useful :)

  3. #3
    Junior Member Settled In Bwad231 is on a distinguished road
    Join Date
    Aug 2009
    Posts
    3
    Rep Power
    0

    Re: Fullscreen background images rotation

    Your my hero Flep!

  4. #4
    Junior Member Settled In assist is on a distinguished road
    Join Date
    Jun 2008
    Posts
    6
    Rep Power
    0

    Re: Fullscreen background images rotation

    Is it possible to change the stripe effect for a fade effect?

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

    Re: Fullscreen background images rotation

    Hi assist,
    replace Background.as with this new one:
    PHP Code:
    /*
     *************************************      
     * @author Filippo Lughi - www.flepstudio.org
     * version Actionscript 3.0                  
     *************************************
     */
    package com.flepstudio
    {
        
    import flash.display.*;
        
    import flash.text.*;
        
    import flash.events.*;
        
    import flash.net.*;
        
    import flash.utils.*;
        
    import caurina.transitions.Tweener;
        
        public class 
    Background extends MovieClip
        
    {
            
    /*//////////////////////////////////////
            *
            *     PROPERTIES
            *
            *///////////////////////////////////////
            
    private const SPEED:int=4;
            private const 
    MASKS:int=10;
            
            private var 
    main:MovieClip;
            private var 
    container_mc:MovieClip;
            
            private var 
    counter:int=0;
            private var 
    ratio:Number;
            private var 
    partial:Number=0;
            
            private var 
    img_array:Array=new Array();
            private var 
    holders_array:Array=new Array();
            
            private var 
    timer:Timer;
            
            
            
    /*//////////////////////////////////////
            *
            *     CONSTRUCTOR
            *
            *///////////////////////////////////////
            
    public function Background()
            {
                
    addEventListener(Event.ADDED_TO_STAGE,init);
            }
            
            private function 
    init(evt:Event):void
            
    {
                
    removeEventListener(Event.ADDED_TO_STAGE,init);
                
                
    main=parent as MovieClip;
                
                
    ratio=100/Main.bg_images_array.length;
                
                
    loadImage();
            }
            
            
            
    /*//////////////////////////////////////
            *
            *     LOADING IMAGES
            *
            *///////////////////////////////////////
            
    private function loadImage():void
            
    {
                var 
    request:URLRequest=new URLRequest(Main.bg_images_array[counter].path);
                var 
    loader:Loader=new Loader();
                
    loader.contentLoaderInfo.addEventListener(Event.OPEN,onLoadingOpen);
                
    loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onLoadingProgress);
                
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadingComplete);
                
    loader.load(request);
            }
            
            private function 
    onLoadingOpen(evt:Event):void
            
    {
                
    evt.target.removeEventListener(Event.OPEN,onLoadingOpen);
                
    trace("loading image "+counter);
            }
            
            private function 
    onLoadingProgress(evt:ProgressEvent):void
            
    {
                var 
    percentage:Number=(evt.bytesLoaded/evt.bytesTotal)*ratio;
                var 
    total_percentage:Number=Math.floor(partial+percentage);
                
    main.position_bar_mc.scaleX=total_percentage/100;
            }
            
            private function 
    onLoadingComplete(evt:Event):void
            
    {
                
    evt.target.removeEventListener(Event.COMPLETE,onLoadingComplete);
                
                var 
    bitmap:Bitmap=evt.target.loader.content as Bitmap;
                
    bitmap.smoothing=true;
                
    img_array.push(bitmap);
                
                
    partial+=ratio;
                
                if(
    counter<Main.bg_images_array.length-1)
                {
                    
    counter++;
                    
    loadImage();
                }
                else
                {
                    
    main.hideLoader();
                    
                    
    counter=0;
                    
                    
    createImages();
                }
            }
            
            
            
    /*//////////////////////////////////////
            *
            *     CREATING IMAGES AND MASKS
            *
            *///////////////////////////////////////
            
    private function createImages():void
            
    {
                
    container_mc=new MovieClip();
                
                for(var 
    i:int=0;i<img_array.length;i++)
                {
                    var 
    clip_mc:MovieClip=new MovieClip();
                    
    holders_array.push(clip_mc);
                    
    img_array[i].width=stage.stageWidth;
                    
    img_array[i].height=stage.stageHeight;
                    
    clip_mc.addChild(img_array[i]);
                    
                    
    container_mc.addChild(clip_mc);
                }
                
                
    addChild(container_mc);
                
                
    main.resizeBg();
                
    slideImages();
                
    startTimer();
            }
            
            
            
    /*//////////////////////////////////////
            *
            *     START TIMER
            *
            *///////////////////////////////////////
            
    private function startTimer():void
            
    {
                
    timer=new Timer(SPEED*1000,0);
                
    timer.addEventListener(TimerEvent.TIMER,slideImages);
                
    timer.start();
            }
            
            
            
    /*//////////////////////////////////////
            *
            *     SLIDE IMAGES
            *
            *///////////////////////////////////////
            
    private function slideImages(evt:TimerEvent=null):void
            
    {
                
    trace(counter);
                var 
    counter2:int=counter+1;
                if(
    counter2>Main.bg_images_array.length-1)
                    
    counter2=0;
                
    container_mc.setChildIndex(holders_array[counter],container_mc.numChildren-1);
                var 
    clip_1_mc:MovieClip=holders_array[counter];
                var 
    clip_2_mc:MovieClip=holders_array[counter2];
                
    clip_2_mc.alpha=0;
                
                
    Tweener.addTween(clip_1_mc,{alpha:1,time:1,transition:"easeOutCubic"});
                
                
    counter++;
                if(
    counter>=Main.bg_images_array.length)
                    
    counter=0;
            }
        }

    and re-create the swf.

  6. #6
    Junior Member Settled In assist is on a distinguished road
    Join Date
    Jun 2008
    Posts
    6
    Rep Power
    0

    Re: Fullscreen background images rotation

    Hi Flep,

    Thank you so much for the prompt reply, I have replaced the code and it works. Once again thanks.

  7. #7
    Junior Member Settled In jakes is on a distinguished road
    Join Date
    Jan 2009
    Posts
    12
    Rep Power
    0

    Re: Fullscreen background images rotation

    Very nice indeed. Would it be possible to add more transitions and control? Such as loading an AS library of random transitions and being able to set it to pick one or use "random" transitions.

  8. #8
    Junior Member Settled In assist is on a distinguished road
    Join Date
    Jun 2008
    Posts
    6
    Rep Power
    0

    Re: Fullscreen background images rotation

    Hi Flep, one more question if you don't mind. I would like to implement this fullscreen background to a website I am creating, to use as a background. I would like to place it on a keyframe within my site. Is there a simple way of doing it?

  9. #9
    Junior Member Settled In mazook is on a distinguished road
    Join Date
    Sep 2009
    Posts
    4
    Rep Power
    0

    Re: Fullscreen background images rotation

    Highly enjoyable! Thanks Man!!!!!!

  10. #10
    Junior Member Settled In freesty is on a distinguished road
    Join Date
    Apr 2008
    Posts
    2
    Rep Power
    0

    Re: Fullscreen background images rotation

    First of all thank you for the example. Works great with original version. However, if I try to replace the Background.as I get a few errors.

    It seems to me that there is something wrong in this part?

    if(counterMain.bg_images_array.length-1)
    counter2=0;

    Like counter2 is not declared, and also counterMain?

    I tried to alter to something like this:

    var counter2:int=counter+1;

    if(counter2>Main.bg_images_array.length-1)
    counter2=0;

    But didnt work. Wondering how you guys further up managed?

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. FullScreen images gallery
    By Flep in forum FlepStudio utilities
    Replies: 9
    Last Post: 24-07-09, 05:35
  2. controlled rotation
    By Jackalope in forum Actionscript 3.0 newbies
    Replies: 0
    Last Post: 18-02-09, 06:28
  3. urgent! collision/gravity + rotation
    By nasgerl in forum Actionscript 3.0 newbies
    Replies: 0
    Last Post: 18-11-08, 07:31
  4. Getting started with a 3d image rotation, help...
    By wuzzi2ya in forum advanced Actionscript 3.0
    Replies: 0
    Last Post: 07-11-08, 21:12
  5. distanziamento rotation
    By lorenzz in forum Actionscript 3.0 avanzato
    Replies: 4
    Last Post: 12-04-08, 12:38

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