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

Creating a First Web Site with Flash CS4 Professional

Dynamically loading images


From:

Creating a First Web Site with Flash CS4 Professional

with Paul Trani

Video: Dynamically loading images

Ultimately what Flash is going to produce is an SWF file. This is great. It's usually a really small file and I can see there is this floating image file. It's 279 kilobytes. So it's pretty small and let's go ahead and take a look at what is contains. I open it up. There are all the sections in here including this Portfolio section. Now what's going on here is this image is actually embedded within the SWF file, but what I want to do is I want to make this SWF smaller so it's faster to download and quicker for people to see. But I still want to keep all the content in it, so I don't want this to affect content at all.

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 CS4 Professional
3h 8m Beginner Apr 15, 2009

Viewers: in countries Watching now:

Information on how to learn Flash is prevalent, but it can be frustrating to understand how to make an entire working web site using this unique technology. Here's a course that cuts through the clutter and offers practical tools for creating a dynamic web site, even for first-time developers. In Creating a First Web Site with Flash CS4 Professional, veteran Flash instructor Paul Trani simplifies the process of integrating animation, video, audio, and user interactivity to create a site that is dynamic and appealing. The goal of this hands-on workshop is to teach web site-building skills for today's demanding interactive industry. Exercise files accompany the course.

Topics include:
  • Manipulating images for the best results
  • Integrating assets from other Adobe products
  • Creating buttons with ActionScript
  • Embedding links to external web sites
  • Exploring text layouts
  • Customizing interactive contact forms
Subjects:
Web Web Design Projects
Software:
Flash Professional
Author:
Paul Trani

Dynamically loading images

Ultimately what Flash is going to produce is an SWF file. This is great. It's usually a really small file and I can see there is this floating image file. It's 279 kilobytes. So it's pretty small and let's go ahead and take a look at what is contains. I open it up. There are all the sections in here including this Portfolio section. Now what's going on here is this image is actually embedded within the SWF file, but what I want to do is I want to make this SWF smaller so it's faster to download and quicker for people to see. But I still want to keep all the content in it, so I don't want this to affect content at all.

So I'm going to dynamically pull in this image. I'm going to take it out of Flash. I'm going to dynamically pull it in from this folder. So I'm going to close this. I'm going to pull in that image from the Images folder. If I look in here, this is the image I want to pull in. And again the reasons I want to do that is it's going to make my file size smaller for my SWF, and it's going to enable me to update my web site without going into Flash. Okay, so in Chapter 6 I'm dealing with this LoadingImage FLA file and if I scroll down to this Portfolio section, here is the image that I want to change.

So I need to double-click in the content_mc, double-click again to enter the Portfolio movie clip, and right here you can see this is the image that I want to dynamically pull in. In fact what I'm going to do now is I'm just going to delete it. There we go. Just deleted that image. Now in place of that image I'm going to use a component. I'm going to use the UILoader component, very powerful and really easy to use. So with that example-lg layer selected, that's where I'm going to put my component. Let's go to Window, down to Components, and in the Components panel, if you twirl down user interface, near the bottom is this UILoader component. Very powerful and all I need to do is click and drag it onto my stage and position it where I want this image to load into.

All right, now he is roughly in position. I can go ahead and close the Components panel and let's take a look at the different parameters and settings I have for this UI Loader. So let's go to Window, down to the Component Inspector and take a look at what this component contains and what we can modify. So from the Component Inspector I can auto-load it. I want to make sure I'm maintaining the aspect ratio. I don't want to scale down the content. I want it to appear at actual size, and not scale down to this little square.

Even though what I sometimes will do is select the Free Transform tool and scale it out a little larger. I can do that if I want to. But in general if I undo that scale, just know that it doesn't matter, the size of this UILoader component, because anything that gets pulled in it's going to keep its content exactly at 100%. So I'm changing this scale content to false. The most important parameter in here is this source parameter. Now remember I went into the images folder and I want to target the portfolio01.jpeg.

That's the image I want to target, and hit Enter. So that's what's going to be loaded in right in here. All right, so let me close the Component Inspector and let's go to Control > Test Movie. Now when I go to the Portfolio section, what's interesting in it is it should look exactly the same, and it does. And that's what you want your users to experience. You want them to experience the full site, but not have to deal with a huge download at the beginning. In fact, if I close this and I minimize Flash, I can see that this SWF file is smaller as well. It's not down to 213 K.

So again that's your goal, make your initial site a quick download and dynamically load as much content as you can, especially when it comes to the user first initiating the content before downloading it as well. But again, this is going to keep your file size really small and it's not going to sacrifice any of your content, if you do things this way. Very powerful!

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


Expand all | Collapse all
Please wait...
Q: If I create a website using Flash CS4 on a Mac, can I edit it on a PC using Flash CS4?
A: As long the file is saved as a .FLA file with the extention ".fla" typed at the end of the filename when saving on a Mac, it should open with no problem on a PC.
Share a link to this course
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.

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 CS4 Professional.

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


OK

Course retiring soon

Creating a First Web Site with Flash CS4 Professional will be retired from the lynda.com library on April 24, 2014. Training videos and exercise files will no longer be available, but the course will still appear in your course history and certificates of completion.


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
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



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.

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