Custom Search
Avatar
1 views

Using FaderFileMaterial to create Slideshow

By: http://www.designscripting.com/2009/01/20/using-faderfilematerial-to-create-slideshow

The aim of this tutorial is to create slideshow using the FaderAPI.

FaderAPI that I released last week can be used to create Flash Slideshow within few steps. FaderAPI contains Fader Class and FaderFileMaterial classes to load and animate external Image and SWF files.

Features:
Some exciting features of the Slideshow are as follows

• Ability of handling Image and SWF together.
• SWF may also be an animated file.
• No Need of Preloader- Since the animation will not happens until the next file is loaded.
• Customized events to handle the Slideshow

Difficulty:
Beginners to Medium

FaderFileMaterial:

Here we are going to use the FaderFileMaterial to create slideshow.
FaderFileMaterial is a Class under FaderAPI, to load external contents like Image, SWF and animate them.
Now this makes the loading external content easier and animating them.

Steps to create Slideshow using Actionscript:

Import External Classes:

import com.utils.Fader.*;
import com.utils.Fader.FaderURL;
import com.utils.Fader.Events.*;

Importing the external classes makes the external classes available to use in Code.

Create FaderURL:

var _faderURLItems:FaderURL = new FaderURL();
_faderURLItems.addURL( "Images/image1.jpg" );
_faderURLItems.addURL( "Images/image2.jpg" );
_faderURLItems.addURL( "Images/image3.jpg" );
_faderURLItems.addURL( "Images/image4.jpg" );
_faderURLItems.addURL( "Images/image5.jpg" );
_faderURLItems.addURL( "SWF/swf1.swf" );

Create object for FaderURLItems, FaderURLItems are used as stack to store URLS of the external files.
addURL is public method of FaderURLItems to push URL into FaderURLItems Object. Later we will fetch URL one by one to load the external files.

Create FaderFileMaterial:

var _fader:FaderFileMaterial = new FaderFileMaterial( _faderURLItems, 5000, true );
_fader.addEventListener( ObjectEvent.FADER_INIT, handleInit );
_fader.addEventListener( ObjectEvent.FADER_ITEM_INIT, handleItemInit );
_fader.addEventListener( ObjectEvent.FADER_ITEM_PROGRESS, handleItemProgress );
_fader.addEventListener( ObjectEvent.FADER_ITEM_COMPLETE, handleItemComplete );
_fader.addEventListener( ObjectEvent.FADER_COMPLETE, handleComplete );
addChild( _fader )
_fader.start();

FaderFileMaterial fades the loaded external items. We are passing the Object of FaderURLItems which contains the URLS, delay, and Boolean to repeat the slideshow at end to constructor of FaderFileMaterial

fader.start() will initiates the Slideshow.

Note:
Add the Fader Object to the displayList. This makes the slideshow visible.

Online Documents for Classes used

FaderURL
FaderFileMaterial

Entire Example:

import com.utils.Fader.*;
import com.utils.Fader.FaderURL;
import com.utils.Fader.Events.*;

var _faderURLItems:FaderURL = new FaderURL();
_faderURLItems.addURL( "Images/image1.jpg" );
_faderURLItems.addURL( "Images/image2.jpg" );
_faderURLItems.addURL( "Images/image3.jpg" );
_faderURLItems.addURL( "Images/image4.jpg" );
_faderURLItems.addURL( "Images/image5.jpg" );
_faderURLItems.addURL( "SWF/swf1.swf" );

var _fader:FaderFileMaterial = new FaderFileMaterial( _faderURLItems, 5000, true );
_fader.addEventListener( ObjectEvent.FADER_INIT, handleInit );
_fader.addEventListener( ObjectEvent.FADER_ITEM_INIT, handleItemInit );
_fader.addEventListener( ObjectEvent.FADER_ITEM_PROGRESS, handleItemProgress );
_fader.addEventListener( ObjectEvent.FADER_ITEM_COMPLETE, handleItemComplete );
_fader.addEventListener( ObjectEvent.FADER_COMPLETE, handleComplete );
addChild( _fader )
_fader.start();

function handleInit( e:ObjectEvent ):void{
 trace("::::::::::Fader Started:::::::::")
}
function handleItemInit( e:ObjectEvent ):void{
 trace("init:: "+e.targetObject)
}
function handleItemProgress( e:ObjectEvent ):void{
 trace("progress::"+_fader.loaderPercentage)
}
function handleItemComplete( e:ObjectEvent ):void{
 trace("complete:: "+e.targetObject)
}
function handleComplete( e:ObjectEvent ):void{
 trace(":::::::::Fader Complete:::::::::")
}

stop_mc.addEventListener( MouseEvent.CLICK, handleStop );
start_mc.addEventListener( MouseEvent.CLICK, handleStart );

function handleStop( e:MouseEvent ):void{
 _fader.stop();
}
function handleStart( e:MouseEvent ):void{
 _fader.start();
}

1,703 views

40 Free Icon Sets

icon set

Smashing Magazine collected another nice set of free icons for you to download and use. This time you can choose between 40 different sets. From large icons to small, mac and pc.

6,911 views

Fabulous Free Icon Sets (35)

Via smashingmagazine.com

Some examples:

freeicons

dinos.jpg

mf.jpg

pi_diagona_pack.png

cs3.jpg

16,071 views

Free Vector Downloads

I leave here a link for a good collection of vector graphics for you to use.

If you check the comments at the site you will find even more nice links to get some vectors. Very useful.

vector
2,089 views

iStockphoto adjusting the price structure for photographs, vector illustrations and flash files

istockphoto

2,375 views

Iconfinder – The best search engine for icons

icon.png

25,503 views

Vecteezy – Stupid Name. Cool Vectors!

Vecteezy is an index of Free Vectors available for download by some of the best designers around the world. vectors.png

3,876 views

More Free Icons

I have found another list of free icons to download via Lifehacker.Really worth a look, some great icons there. Great usability.

Get them here

1,581 views

Colour combinations in web design

Great article that will sure help you choose the colours for your next work.

A must read for every web designer

2,440 views

Icons Download Win / Mac

Nice webpage with lots of icons both for Win and Mac. You will also find an option at the main menu: “For Developers”, where you will find more icons. Those at that section aren’t free; you will have to pay to get them.

Take a look at the icons here

2,681 views

Getty acquires iStockphoto for $50 million

iStockphoto, the world’s most popular stock photography website, has announced that it has been acquired by Getty Images, Inc, the world’s largest stock photo company.

Read more

1,727 views

May 1st Reboot 2006

Sign-up, login, enter in your information, and you will appear in the Participants list. :)

You´ll find there great work examples from people all over the world.

May 1st Reboot Website

2,063 views

Newwebpick e-zine 03

The Newwebpick e-zine 03 is available to download.

I really haven´t check it yet, but i have downloaded e-zine 01 and e-zine 02 and they were pretty cool.

PC and Mac versions available here (30Mb).

2,496 views

CSSVista

Edit your CSS code live in both Internet Explorer and Firefox simultaneously.

More info & download here.

Take a look at the screenshot ;)

1,476 views

Designfest 2005

Designfest 2005

1,489 views

Web Design References

Good articles about Flash and Web Design and Development. There are two new articles in Flash, “Samples of Accessible Flash” and “WCAG 1.0 Techniques for Flash”…

This is a quality link.

UNIVERSITY OF MINNESOTA DULUTH

1,532 views

I Like Your Colors

Use this tool to extract the colors from the HTML and CSS of any web site. Compare the colors easily using hue groups.

I Like Your Colors

Take a look here too. There are two more cool tools that might be useful for WordPress user´s.

1,692 views

Size does matter…

I have seen so many questions about this topic in different forums that i have decided to post here a link which will help you decide which stage size should be used to develop your Flash applications for web.

First you must decide for which screen resolution do you want to develop, or you can develop for two or three different resolutions giving the user the option to choose their resolution. However after this decision you must remmember the users from other plataforms like Mac and browsers like Firefox and Safari. Believe me, it´s important to develop your application to all those users. So how can you avoid your page from looking crappy in some browser or platform?

At Webmonkey you will find all these answers. In there you will find tables that will give you the safest size to develop in different browsers and in each different resolution. Now you only have to choose.

Good luck.

2,502 views

Web Design Resources Links

I am posting here a website that claim to have 860 links to Web Design Resources. In there you will find many places where you can find:

- Fonts
- Stock Photography
- Sounds
- Vector Clip-Art
- Logotypes
- Photoshop Brushes
- 3D Poser Downloads
- Color Tools
- Text Generators
- Patterns
- Design Contests

Check it now @ Blue Vertigo

,

actionscript 3.0 Adobe adobe max adobe tv air application class components contact form database facebook Flash flash catalyst flash cs4 flash gallery flash game flash menu Flash Tutorial flash tutorials Flash Video flash website Flex Flex Tutorial flex tutorials google maps mp3 player papervision 3d php video tutorial xml
Powered by FeedBurner