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

Allowing for unlimited thumbnails

From: Creating a Portfolio Web Site Using Flash CS4 Professional

Video: Allowing for unlimited thumbnails

So here is my portfolio as it stands right now. I have two thumbnails and what I'm going to want to do is I'm going to start to add more thumbnails on down the line, until they actually go off the screen, and then I want to add a scroll pane component, so I can scroll those images. What this allows for is an unlimited number of images for your portfolio. So I'm going to go into the code, this first frame of the AS layer, and I'm going to go to Window>Actions, and right in here, you can see that I have the current two thumbnails.

Allowing for unlimited thumbnails

So here is my portfolio as it stands right now. I have two thumbnails and what I'm going to want to do is I'm going to start to add more thumbnails on down the line, until they actually go off the screen, and then I want to add a scroll pane component, so I can scroll those images. What this allows for is an unlimited number of images for your portfolio. So I'm going to go into the code, this first frame of the AS layer, and I'm going to go to Window>Actions, and right in here, you can see that I have the current two thumbnails.

All I'm going to do is just paste in code for a total of ten images. I'll just review how these change from thumbnail to thumbnail. As you can see, thumbLoader2 moves over 100 pixels. So this thumbLoader3, I had to create. Again, give it an instance name, and it moves over 200 pixels. So it's not on top of the previous one. Not only that, I've changed the thumbnail image, the large image, and then the content that goes in the text fields.

So that's what happens for each one. It's a matter of changing the instance name, the JPEGs, and then the functions as well. So that's kind of how it goes on down the line, and make sure you just change the instance names from one to the next. So I'm going to run this, just so you can see all of the various images. There they all are. You can tell that, actually, it does start to run off. If I expand that out, you can see this street trends image, which the user just wouldn't be able to get to, not unless I add a way to scroll to it, but otherwise, all of these are working just fine.

So I'm going to go ahead and add a UIScrollBar Component. So let me close that Actions panel, but before I do, I'll just pin the code to it. It does stay up when I open it back up. What I want to do is go to Window, down to Components. In my Components panel, I want to select this ScrollPane component. So I'm just going to scroll down the page, and click and drag this on to my stage. Now I can close that panel.

From here, what I can do is I can start to resize it. In fact, I can use the Free Transform tool. I'll double click on that center point, just to move it to the upper left-hand corner, so I can scale it out appropriately. I can go ahead and scale that out and do a Command+Minus to zoom out some, and I can start to position this in its appropriate place. I could even use my arrow keys to adjust it, but in general, it's going to just exist at the base of this page, kind of like that. That looks pretty good.

For the most part, it's set up. What I need to do is I need to give it an instance name, so I can reference it in my Actionscript. So with this component selected in the Properties panel, I am going to give it an Instance Name of myScrollPane. All right, myScrollPane. So I'm going to go ahead and do a Command+C to copy that. Now let me go into my Actions. That's that first frame, and what I want to do is I want to go ahead and attach all of these thumbnails to myScrollPane.

So at the very top of your code, just paste in myScrollPane, so that's the instance name, and I want to set the source equal to allThumbnails. So all the thumbnails that are in there, just copy that and paste it. That's what's going to go in the source for the myScrollPane. So, it's going to go ahead and attach appropriately. So let's do a Control>Test Movie, and what I'm going to do is I'm going to right-click and I'm going to do a Show All, because my screen size is a little small, and I can start to just scrunch that down.

The scroll pane is actually there, but you don't really see it working, because what you'd need to do is you need to update the scroll pane as each image gets loaded in. So I want to do that, now I want to update it. So myScrollPane, when it loads in this thumbnail, I want to update my scroll pane. So it's as simple as myScrollPane.update, just like that.

Now I'm going to copy this line of code, Command+C, because I want to update it as they get placed in here. So I'm going to update it after it's placed in at that position. This third one, it's going to update. So again, it's just a matter of adding this line of code for each one of these functions, right after if it's placed on the stage. The ScrollPane Component will actually reference the size of these thumbnails, and adjust its scrollbar accordingly.

So paste that last one in, and we are looking pretty good. So let's do a Control>Test Movie. I do need to kind of scrunch this down some and I need to Show All, just to get it our viewable area, but you can see that I do have a scrollbar and I can easily scroll from left to right. Now notice it also added this vertical scrollbar. Well, that's easy to fix as well, because I can just close this SWF file. And I could probably write some code to do that, but the easiest way to do that is just to select your component, go to window and open up Component Inspector.

And right in here, I can adjust the horizontal and even the verticalScrollPolicy, because I don't want it to automatically add that scrollbar. I always want it to be off. So I'm going to change that verticalScrollPolicy. Never show me that vertical scrollbar. I'll go ahead and do a Test Movie. Scrunch this down, just so we can see this really fast. Show All, and the vertical scrollbar is gone, but the horizontal one is still there.

It works like a charm, because now I can click on each of these and I can finally get down to this last image, and this is really built for unlimited images. So the more I add to my code, the more I can scroll, but in general, this is really flexible and it's suited to fit whatever size portfolio you might have.

Show transcript

This video is part of

Image for Creating a Portfolio Web Site Using Flash CS4 Professional
 
Expand all | Collapse all
  1. 1m 41s
    1. Welcome
      1m 7s
    2. Using the exercise files
      34s
  2. 24m 1s
    1. Understanding web design
      2m 44s
    2. Creating a Flash file
      3m 18s
    3. Importing a design from Photoshop
      7m 45s
    4. Optimizing the design
      10m 14s
  3. 13m 59s
    1. Dynamically loading an image
      3m 37s
    2. Loading random images
      10m 22s
  4. 47m 38s
    1. Creating menu buttons
      8m 18s
    2. Adding functionality to buttons
      8m 56s
    3. Adding navigation
      9m 45s
    4. Creating transitions
      12m 0s
    5. Simplifying code
      8m 39s
  5. 26m 11s
    1. Creating web site sections
      7m 41s
    2. Dynamically loading sections
      11m 7s
    3. Linking to web sites and email addresses
      7m 23s
  6. 29m 18s
    1. Setting up a portfolio
      12m 31s
    2. Adding functionality to thumbnails
      10m 10s
    3. Allowing for unlimited thumbnails
      6m 37s
  7. 41m 17s
    1. Benefits of using XML
      4m 42s
    2. Loading XML content
      4m 34s
    3. Sorting XML content
      7m 32s
    4. Displaying XML content
      7m 35s
    5. Using XML to create thumbnails
      8m 41s
    6. Displaying content with thumbnails
      8m 13s
  8. 25m 59s
    1. Creating and importing video
      9m 47s
    2. Adding a Full Screen button
      4m 15s
    3. Creating custom video controls
      4m 50s
    4. Adding functionality to video thumbnails
      7m 7s
  9. 9m 12s
    1. Adding audio to buttons
      5m 30s
    2. Adding audio to dynamically created buttons
      3m 42s
  10. 21m 19s
    1. Applying professional transitions
      9m 26s
    2. Creating a preloader
      8m 56s
    3. Publishing a web site
      2m 57s
  11. 3m 15s
    1. Reviewing the "corporate" Flash site
      1m 40s
    2. Reviewing the "artistic" Flash site
      1m 35s
  12. 12s
    1. Goodbye
      12s

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 Portfolio Web Site Using Flash CS4 Professional.

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.