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

Creating a Portfolio Web Site Using Flash CS4 Professional

Displaying XML content


From:

Creating a Portfolio Web Site Using Flash CS4 Professional

with Paul Trani

Video: Displaying XML content

Now once you can trace out XML content in Flash, the next thing you're going to want to do is to put this data into containers to be accessed when needed, and probably the most flexible container is going to be an array. But as you'll notice, here are all of my different items being traced out. I have the title, the Description, large image, thumbnail and what I want to do is to put all of these in a large container, so all of the titles will go in an array. And what an array is is kind of like if I had a big moving truck and this truck is filled with boxes, well, each box would be an item and in this box could contain any type of item I want it to contain.
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

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 Portfolio Web Site Using Flash CS4 Professional
4h 4m Intermediate Feb 17, 2010

Viewers: in countries Watching now:

Flash and ActionScript are ideal for creating flexible, easily updatable web sites that are both unique in design and small in file size. In Creating a Portfolio Web Site Using Flash CS4 Professional, Adobe Certified Instructor Paul Trani shows how to exploit Flash to create a web site that showcases work to clients and prospective employers. Find out how to add dynamic navigation, animation, and video to a page, and how to load, sort and display XML that enables portfolio content to be updated without opening Flash. This course is designed to take your existing tweening skills and gotoAndPlay code and walk away with a fully functional Flash site. Exercise files accompany the course.

Topics include:
  • Optimizing and publishing a Flash web site
  • Designing a professional photo or video portfolio
  • Adding button interactivity
  • Adding functionality to portfolio thumbnails
  • Displaying content with XML
  • Adding audio to portfolio presentations
Subjects:
Web Web Design Projects
Software:
Flash Professional
Author:
Paul Trani

Displaying XML content

Now once you can trace out XML content in Flash, the next thing you're going to want to do is to put this data into containers to be accessed when needed, and probably the most flexible container is going to be an array. But as you'll notice, here are all of my different items being traced out. I have the title, the Description, large image, thumbnail and what I want to do is to put all of these in a large container, so all of the titles will go in an array. And what an array is is kind of like if I had a big moving truck and this truck is filled with boxes, well, each box would be an item and in this box could contain any type of item I want it to contain.

In this case, it's going to be a truck full of titles, and each title contains some specific information. So that's what I want to make. I am going to my Timeline panel. I'm going to go to this first frame here and I'm going to go to Window and open up the Actions panel and right at here, at the very top, I'm just going to go ahead and type in Array. Now notice it is a keyword, so I can select it and I can View the Help on it. So here I can read more about arrays, but notice there are some examples right down in here.

So to make an array, I would create a new variable and give that variable a name and then go ahead and create the array and I can have certain values in that array, certain boxes if you will. But I'm going to go ahead and just copy this first line here as a starting place. All right. I can paste this code in and I don't want this to be a oneArray, but again, I want this to hold the titleArray. Okay that's the name of this moving truck, titleArray is an array and here's where I access the array class and I'm just going to clear out this information, because I want to put content in it later.

So I am going to do the same thing for the other items in our XML, such as the largeImageArray and again, this is going to be the same, so I'm just going to go ahead and copy this. Command+C, Command+V just like that, var thumbnailImageArray, and notice that I actually do have two colons there, so I will remove those and I'll start to put this in that more of a readable order because I want to have my descriptionArray right underneath my titleArray and then there we are. All right.

So this does follow sort of the same format that I have down here, sort of the title, Description, large image and then the thumbnail. But now that I have these arrays created, I want to push content into them. So I want to load it up with information. Now I can go back to my Help and you'll notice that arrays do a lot of different things from popping, from pushing. You can read each one, but it adds elements to the array is what push does. So that's what I want to do is I want to push information into it, so it's like loading up the truck. All right.

And the information I want to push is all of this information in here. So it's going to include the title, Description, large image and thumbnail. So what I'm going to go ahead and do is let's go ahead and type in titleArray and push and within those two parenthesis, I'm just going to take this data and I'm going to put it right in there. All right. So that looks good. I will, in fact, delete that, descriptionArray, push content into it as well and it's going to be this information right here.

Drag that on in there. Next up is, of course, the largeImageArray, push content into it, drag that on in there. and start to eliminate these trace elements and last one I need to do is, I've gotta make sure this is right, thumbnailImageArray. That's a very long word, so I'm just going to go ahead and copy it and paste it right here. thumbnailImageArray push data into it as well and it's going to be this data, just like that.

So with that setup, it's going to push all of this information into these arrays and notice how it gets loaded up as it actually comes through here and I've this for loop, so it loops through it for the length of the array. It starts pushing the title in for each title and all the descriptions go in this array and all the images and than all the thumb images go in their specific arrays as well. So now that the information is in there, I'm going to show you how I can use it. So if I scroll down further, you can see that there's this thumbLoader, and what this thumbLoader does is it loads in the first image, the first thumbnail into this thumbLoader.

So what I want to do is I want to start using some of that information down in here. So that very first image, well, you know what I want to do is I want to change its source. I want to change it from this hard coded link to that image to what's in the XML. So I'm just going to go ahead and type in 'largeImageArray' and I'm going to go ahead and do an open bracket, close bracket and then I'm going to type a number in here. So whatever item in the array that I want to put in here, I can go ahead and just type that in there.

So if I want to access the very first largeImage, I can just type 0 in there. All right. Next up, I am going to do the same thing for this title. It's not going to be Basketball any more. It's going to be titleArray and again, open close brackets, and then within those two brackets I'm just going to go ahead and type 0. Lastly, again, this is all hard coded and I want it to come from the XML, so I'll delete it and I can type in 'descriptionArray' open bracket, close bracket, zero.

Make sure we get that spelling right, descriptionArray, make sure all the stuff matches up and these are the items I'm going to get. So it's looking pretty darn good and notice initially, what was in there was of course all about Basketball and I'm leaving this the way it is just to show you that this information that's getting loaded in is going to be different than what the image displays. So I'm going to do Control>Test Movie and I'm going to run it and for Basketball, if I click on that and maybe I click on one of these other ones, but you can see, if I click on this basketball image it changes the text to Our Future Generations and then also it gives the description right down here and then displays that large image.

So it's working out quite well. It's changing that information and it's all based on the XML. So this is really working for me. In fact, I can go through and do the same thing. In fact, if I just copy these three lines, right-click Copy, I could do the same thing for this next thumbnail. Paste that in and then the only change I need to make is change that from 0 to 1, just like that. So now when I run it, you can see that when I select this cafe buena image, it's actually going to be the Basketball image.

So you can see how things are changing. They're no longer what they were, but it's actually referencing XML content. Notice that the thumbnail images don't sync up with the large images. Not to worry. I'm going to sync this up later.

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


Expand all | Collapse all
Please wait...
Q: While following along with the course, I encountered the following error in Flash CS4: 
1120: Access of undefined property content_mc.
What is causing this error?
A: Flash is looking for something (the content movieclip) with the instance name “content_mc” but it is not finding it. Select the content movieclip on the stage. In the Properties panel give it an instance name of “content_mc”. Make sure there are no spaces before or after. That should resolve the error.
Q: What is the best strategy for integrating 720/60P HD video into a website? Would creating a blank page that opens in full HD resolution be the best way to view the full quality of the HD video file?
A: A video file that large would just be unreasonable for most users to open.  These settings are a good place to start: 600x400is
24-25fps
Audio: 128kbps
Codec: On2VP6
Bitrate level: 1,000kbps
Bitrate Encoding: VBR These are just recommendations, and can be modified to preference. Also keep in mind that in Flash, one of the buttons that can be added is a full screen button, which is part of the skins.
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 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
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