Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Adding a progress bar

From: Creating a First Web Site with Flash Professional CS5

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.

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.

Show transcript

This video is part of

Image for Creating a First Web Site with Flash Professional CS5
Creating a First Web Site with Flash Professional CS5

34 video lessons · 28204 viewers

Paul Trani
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
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

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?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

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 preferencesfrom 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.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

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.