New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Start learning with our library of video tutorials taught by experts. Get started

Creating a First Web Site with Flash Professional CS5
Illustration by

Loading an external image


From:

Creating a First Web Site with Flash Professional CS5

with Paul Trani

Video: Loading an external image

Now you don't necessarily want to import all of your images into your Flash project. You really just want to import the main content and then keep optional information and optional content external from the file. That's going to make your initial file size smaller and only load in the images as the user requests them, and that's what I want to do here. Notice as I scroll through to this Portfolio section I have this empty frame right here. So what I want to happen in this dynamically I want to load an image in this area.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
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
Subjects:
Web Interaction Design Projects
Software:
Flash Professional Illustrator
Author:
Paul Trani

Loading an external image

Now you don't necessarily want to import all of your images into your Flash project. You really just want to import the main content and then keep optional information and optional content external from the file. That's going to make your initial file size smaller and only load in the images as the user requests them, and that's what I want to do here. Notice as I scroll through to this Portfolio section I have this empty frame right here. So what I want to happen in this dynamically I want to load an image in this area.

Okay that frame is actually a part of the Portfolio bkgd, so I will just double click on that movie clip and come in here. So right in this area this where I want to load in that image, so I going to rename layer 1 to be loaded image. That's where my image is going to go, and in order to load an image in here, I am going to use a component. So let me just move this up some and right in this area, if I go to Window > Components, I can check out all of the components available that I can add to my project.

The component is basically a movie clip with additional functionality. I am going to go into the user interface folder, and I encourage you to check out all of the options we have in here, quite a few, but I am going to choose this UIloader down at the bottom. Very handy because all I need to do is drop it on to my page, and then I can reposition it. Let me close this. I am going to lock down these other layers, so I don't accidentally select them just by clicking these little lockouts right there.

All right, I can position this sort of right here and what I can do from there is I can resize it, so I can use the Free Transform tool to resize it if I want to and let's not forget that if want exact control, I can modify the properties in the Properties panel. So maybe I want the width to about to be 350. I can type that in, and the height in this case is going to be about 240. I happen to know the size of the image that I am loading in here.

That's why I am adjusting this precisely, and then I can move it into position. All right, so this is where my content is going to load, but now I need to determine the content I am going to load in. So in the Properties panel it actually lists out this source. Okay, and if I click on that, notice I can type something in there, but I actually need to make sure an image is in the right location. So I am going to go to my desktop, and I am going to go to the assets folder, into my images folder, and this port1.jpg is the image that I want to load in.

So I am going to copy this image, and I am going to go into my folder. This is where my FLA file exists and want I want to do is I want to create a new folder, and I am going to call it images and within that folder that's where I am going to paste in the image I want to access. Okay so now I know where it is in the images folder. I am going to target port1. So I am going to back in the Flash, change the source to point to images forward slash, because it's in that folder, port 1.jpg just like that.

All right, I have targeted that image, Now I need to go ahead and test this project and make sure that image gets loaded in. I will click on Portfolio and sure enough it loads in this image. So that's perfect. I want to load in this image when they click on the Portfolio section, but I don't want to make it actually part of this file as in that it's embedded because that's again going to add to the file size. And now this is actually set up for me to work on some other functionality by adding the ability to load in more images.

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.
Upgrade now


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 Upgrade now

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

Notes cannot be added for locked videos.

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.