• Home

Logo

Navigation
  • Home
  • Articles
    • Content Writing
    • Design
    • General
    • Internet Marketing
    • Social Media
    • Tools and Tips
    • Usability
    • Web Hosting Articles
  • Tutorials
    • AJAX Tutorials
    • ASP Tutorials
    • C# Tutorials
    • CGI and Perl Tutorials
    • CSS Tutorials
    • Flash Tutorials
    • HTML Tutorials
    • Illustrator Tutorials
    • Java Tutorials
    • JavaScript Tutorials
    • Linux Tutorials
    • Miscellaneous Tutorials
    • MySQL Tutorials
    • Photoshop Tutorials
    • PHP Tutorials
    • Python Tutorials
    • Wireless Tutorials
    • WordPress Tutorials
    • XML Tutorials
  • Scripts
    • AJAX Scripts
    • ASP Scripts
    • ASP.NET Scripts
    • CGI & Perl Scripts
    • Flash Scripts
    • Java Scripts
    • JavaScript Scripts
    • PHP Scripts
    • Python Scripts
    • Remotely Hosted
    • Tools and Utilities
    • XML Scripts
  • Answers
  • Online Services
  • Tools

Creating a Professional Looking Animated Preloader

By Oleg Lazarenko | on Mar 16, 2005 | 0 Comment
Flash Tutorials
  • Tweet
  • Share
  • Tweet
  • Share

Professional Flash Preloader

a. Launch Flash MX 2004

b. Create new Flash file. Click File > New…

c. Select Flash Document in a new window

d. You need to create 2 layers in the root of your flash movie. The first layer will serve to contain the preloader and must be consist of one frame, the second one will be used to place the movie content and we need 2 frames in that later. To make thing easier we will name these layers “preloader” and “content”

e. Select “Rectangle Tool”

and draw shape in the first frame of the layer named “preloader”

f. Select the shape and right click on it. In the menu select “Convert to Symbol…”

then select “Movie Clip” option and press OK

g. Now you have included movie in the “preloader” layer. Select the movie you have made and press “F9” to get access to “Action” panel.

It consists of 2 windows. We need to use the right one to continue.

Click on the shape then copy the following code and paste it in the right window:

onClipEvent (load) {

total = _root.getBytesTotal();

}

onClipEvent (enterFrame) {

loaded = _root.getBytesLoaded();

percent = int(loaded/total*100);

text = percent+”%”;

gotoAndStop(percent);

if (loaded == total) {

_root.gotoAndPlay(2);

}

}

h. Select the “preloader” layer (you must see that the code disappear from the right window) and type stop(); in the right window. If you did everything correctly you should get something like the picture below:


Flash Preloader Cont’d

i. Double click the shape to enter the included movie in the “preloader” layer. Now you can see the shape as Flash Object. Select “Rectangle Tool” and draw smaller rectangle with a color different from the white inside the shape (note: the second rectangle must be within the same layer as our shape)

Now delete the second rectangle and its border. Select you shape and you will see that now you have a shape with the rectangle hole inside. That was the purpose of the second rectangle: to make this hole. Through this hole the progress line will be displayed.

j. Create 2 more layers. Lets call the layer with the shape: “Shape” and two new layers we name “Mask1″ and “Mask2″. (Note: the “Shape” layer must be the first layer in a Timeline panel!)

k. Now we need to create simple mask to show the downloading progress. We need to create some more new frames for 3 layers we have. Select all 3 layers, right click and select “Insert Frame” option. You need to make 15 new frames for each layer similar to the picture below.

l. Select layer named “Mask1″, then select “Rectangle Tool”, set the background color to black and draw big rectangle under the main shape. Do not worry about its appearance as it will become invisible after we create mask effect. It must cover the hole of the main shape completely but it should be smaller then the main shape.

m. Select layer named “Mask2″ and draw one more rectangle. On the example picture we disable the big black rectangle so that you could see how the second rectangle must be made:

n. Select the last frame in the “Mask2″ layer, right click and select “Insert Keyframe” to convert last frame to keyframe.

o. Select first frame of the “Mask2″ layer and drag the rectangle so that it ended just before the hole starts.

p. Now select all frames of the “Mask2″ layer, right click and select “Create Motion Tween” You have created the animation to show the download process.

q. Select layer named “Mask1″, right click and select “Mask” option.

Now all set up for preloader. Double click anywhere outside the working area to return to the root of your movie.

r. Select “content” layer, click “File –> Impotr…–> Import To Stage” and insert any picture you like to be in your content movie.

s. Now select the “content” layer (you must see that the code disappear from the right window) and type

stop();

The Timeline must be like this now:

Click “Ctrl+Enter” to see the flash movie. Upload it and when you access it you will see the preloader you just have created first and then the content of your movie!

Now when you visitors come to your website they will be able to see how long it will take to downlod flash. You may use the code and change everything you like in design to match your website.

Click here to download source fla file.

Share this story:
  • tweet

Author Description

Metamorphosis Website Design Studio - Custom design, Website Templates, Web design Articles and Tutorials.

No Responses to “Creating a Professional Looking Animated Preloader”

You must be logged in to post a comment.

Connect With Us

RSSSubscribe 0Followers 494Likes
  • Popular
  • Recent
  • Comments
  • Creating Energy Spheres in Photoshop

    Apr 15, 2008 - 96 Comments
  • Easy Screen Scraping in PHP with the Simple HTML DOM Library

    Aug 6, 2008 - 20 Comments
  • Calculating date difference more precisely in PHP

    Mar 7, 2008 - 13 Comments
  • When Does Hosting Your Website in the Cloud Make Sense?

    Oct 8, 2010 - 2 Comments
  • Fun with the Microsoft Managed Extensibility Framework Part 2

    Oct 6, 2010 - 0 Comment
  • Fun with the Microsoft Managed Extensibility Framework Part 1

    Sep 22, 2010 - 0 Comment
  • Website Management on the go with the iPad

    I appreciated your post, but I was looking for something I didn't...
    November 24, 2012 - drmoderator
  • Creating Energy Spheres in Photoshop

    I'm a little stuck down here especially at the step of creating the...
    November 23, 2012 - sarah
  • Running background processes in PHP

    Can you give an example? As see it, you can use this only when you...
    November 16, 2012 - Shaked Klein Orbach
Developer Resources
  • Tutorial Directory
  • Learn HTML
  • Learn PHP
  • Learn CSS
  • Learn AJAX
  • Learn JavaScript
  • Learn Pear
  • White Papers
  • Resources
    • NetVisits Web Directory
    • Realtor Pixels
    • Answers On The Run
    • Ask A Geek
  • Recent Posts

    • When Does Hosting Your Website in the Cloud Make Sense?
    • Fun with the Microsoft Managed Extensibility Framework Part 2
    • Fun with the Microsoft Managed Extensibility Framework Part 1
    • Website Management on the go with the iPad
    • Code Contracts in C# 4.0 – Part 1

    Calendar

    May 2013
    M T W T F S S
    « Oct    
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  

    Recent Comments

    • drmoderator on Website Management on the go with the iPad
    • sarah on Creating Energy Spheres in Photoshop
    • Shaked Klein Orbach on Running background processes in PHP
    • Thomas Cuvillier on How To Upload Files Using PHP
    • rizal aditya on Extracting text from Word Documents via PHP and COM
    • Home
    © 2003 - 2013 DeveloperTutorials.com. All Rights Reserved. Privacy Policy.