Creating a First Web Site with Flash Professional CS5
Illustration by John Hersey

Adding a progress bar


From:

Creating a First Web Site with Flash Professional CS5

with Paul Trani

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now

Video: Adding a progress bar

One of the final things to add to any site it's going to be the progress bar. And what this does is that it's just actually just shows the progress of things downloading, giving some visual feedback to the user. And that's what I want to do with this site. But before I do so let's go ahead and do a Test Movie. (Music playing) And let's go ahead and check out sort of how this would be downloaded. So I'm going to go to View > Bandwidth Profiler. So this actually gives me a profile of the content that needs to be downloaded.
please wait ...
Watch the Online Video Course Creating a First Web Site with Flash Professional CS5
2h 45m Beginner Jul 27, 2010

Viewers: in countries Watching now:

Creating a First Web Site with Flash Professional CS5 shows how to make a fully functional, dynamic web site in Flash Professional CS5. This course covers the fundamentals of creating and importing content, adding smooth 2D and 3D transitions, and adding button functionality that goes beyond links. This course will also show how to integrate and control video and audio as well as how to implement a gallery and a contact form. Exercise files are included with the course.

Topics include:
  • Understanding web design
  • Creating buttons and web graphics in Photoshop
  • Formatting text with the Text Layout Framework
  • Using the Timeline
  • Creating a custom looping animation
  • Loading images in a gallery
  • Creating invisible buttons
  • Adding music and video to a site
  • Customizing video playback controls
  • Optimizing and publishing a web site
Subject:
Web
Software:
Flash Professional Illustrator
Author:
Paul Trani

Adding a progress bar

One of the final things to add to any site it's going to be the progress bar. And what this does is that it's just actually just shows the progress of things downloading, giving some visual feedback to the user. And that's what I want to do with this site. But before I do so let's go ahead and do a Test Movie. (Music playing) And let's go ahead and check out sort of how this would be downloaded. So I'm going to go to View > Bandwidth Profiler. So this actually gives me a profile of the content that needs to be downloaded.

Notice down here at the bottom it says 648 KB. So again it's a fairly, fairly good size. And if I want to view this as if the users are viewing it, what I can do is I can just check my Download Settings. So I've this set to DSL, but what I want to do is I want to Simulate Download. So notice how I'm giving these little dots in the center right here, indicating that something is going on, but I have no idea how long we'll be sitting here staring at these little dots.

Notice my Bandwidth Profiler does tell me the percentage loaded. So I need to tap in to that data. (Music playing) All right, so again, I want to build in a little bit more of an indicator. And now luckily Flash has built-in a template for this. So I'm going to go to File > New, and it's usually set to the General tab, but I'm going to click on Templates. Down here at the bottom there's Sample Files.

So I really encourage you to check out all of these various template files, because there are some really nice ones in here. So I encourage you to do that just if you have time. What I'm going to do is I'm going to select this Preloader for External File. And it does say that it's a sample file only there are no instructions, but I'm going to walk you through all the steps you need. Select OK and here is my file. All right, so it looks fairly good so far, but what I want to do is I'm going to go ahead and save out this file.

I'm going to save this as preloader, and I'll save it to my folder here. Now, that's saved in the same location as this index.fla. So let's just confirm it is in that same folder. It's going to be saved right here as well. So they're both in the same location. So for this preloader file the first thing I notice is that the Stage size is different. So I want to match the Stage size with the actual movie.

So notice how this actual sort of the final file, 1000 x 600 at 29 frames per second. Well, let me go to the preluder. Let's make sure it's set to 29 frames per second. 1000 pixels wide, by about 600 pixels tall, just like that. Okay, so it's set to the right size. Also the Stage is the wrong color. I want it to be white. So this is just a matter of sort of getting rid of what you don't want, customizing it so it matches the final file as well.

Notice this Background layer contains this design which really doesn't go with what I'm working with. So I'm just going to delete this in its entirety. And what I'm left with is this progress bar and then this Actions layer. So for this progress bar I'm going to go ahead and position it in the center of the Stage. So in order to do that, what I'm going to do is I'm going to open up the Align panel. And from there I can select Align to Stage. And then I can go ahead and click on Align horizontal center and then Align vertical center like that.

All right, now what I've done is I've just aligned this graphic and all this is a movie clip. So can just go ahead and double-click on it and edit it if I want to, to make it potentially match more of what my graphics are in my site. And mine's actually brighter red so I can pick a different red, but this could be anything that you want, whether it's a thin bar, maybe it covers the whole screen, who knows. So I'll go back to Scene 1, I'll select that Actions layer, that first keyframe, and open up the Actions panel and here is my code.

So it does actually create this Loader called contentLoader. And it loads in this content. It's technically a help file. But what I want to do is I actually want to load in the index.swf file. Okay, so I'm targeting this index file right here. That's my index.swf file. And then from there, it's going to go ahead and load in that content and then start to set the progress bar And what it does is that actually scales that progress bar instead of its width.

So it's going to start to stretch out as more and more of the file is downloaded. So again, I'm adjusting the scaleX property is what's going on here. All right, I'll save this file and remember it's targeting that SWF files. So I can do a Control > Test Movie. Let's go ahead and test this. (Music playing) And again, that loaded pretty fast. So again, I want to go Simulate Download. Let's just check my settings are set to DSL.

As it loads in, you can see the progress bar sort of move across. So this gives me good indication of how much data needs to be loaded before I see anything, provides that to the user. And ultimately gives him just a better experience for the site. So again, just use those template files, specifically the preloader for an external file. And you can see that it's easy to use in any project that you might be creating.

Find answers to the most frequently asked questions about Creating a First Web Site with Flash Professional CS5 .


Expand all | Collapse all
please wait ...
Q: I followed all the steps and suggestions in the "Adding a progress bar" video, but when I add the progress bar to my web site, I can’t remove it once the index.swf file loads up. The progress bar remains on the homepage and the rest of the pages. How do I make it disappear once the site loads?
A: To make it disappear, just make sure the progress bar is only in frame 1. If it’s on its own layer, then right-click on the 2nd frame in that same layer and select "Insert Blank Keyframe." That will make it disappear.
Q: Despite following the steps in the "Adding a progress bar" video, I cannot figure out how to keep the progress bar from appearing on a movie that has finished loading. How can I make the progress bar disappear?
A: Just add the red line below to the preloader.fla file. This will make the progress bar invisible: 
"function contentLoaded(evt:Event):void { //Optionally change to a clip holder and set progressbar visibility. addChild(contentLoader); progressbar.visible = false; }"
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

* Estimated file size

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Creating a First Web Site with Flash Professional CS5.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.