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

Creating a Portfolio Web Site Using Flash CS4 Professional

Adding navigation


From:

Creating a Portfolio Web Site Using Flash CS4 Professional

with Paul Trani

Video: Adding navigation

Once the ActionScript structure of a basic button is in place, I can now navigate to this section selected, because currently what's going on, if I go to Control>Test Movie, all I have are these various trace statements that are being shown in the Output panel. But what I want to happen is I want to actually navigate to the video section when I click on the Video button and likewise for all the other buttons. So let's take a look at the code.
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

Adding navigation

Once the ActionScript structure of a basic button is in place, I can now navigate to this section selected, because currently what's going on, if I go to Control>Test Movie, all I have are these various trace statements that are being shown in the Output panel. But what I want to happen is I want to actually navigate to the video section when I click on the Video button and likewise for all the other buttons. So let's take a look at the code.

I'm going to go to the AS layer. I'm going to select that first frame. I'm going to go Window and open up the Actions panel and the first thing I'm going to do is I'm going to pin the code, because, again, I don't want it to move if I click on something else. I want it to always stay up and available. But as you can see, when you click on the home button, all I get is the trace statement and same for the about button and the video button. Now, I'm just going to go ahead and start with the Video button and what you can do is click in this gray bar.

You can just retract the Actions panel, so it's out of the way. I am going to Command+Minus to zoom out. I want to move this content movie clip this direction, and I want to change the X and Y position of this content and see. It starts out. Again, I'm going to do an Undo Move. It's going to start here and then I want it to end up right here. So let's go ahead and reference the X and Y position.

So in the Properties panel, with the content movie clip selected, I can see that the Position and Size, the X is -920. In fact, I'll just round that to 920 and then the Y is about 530, maybe I want to make it about 520 or let's go 540, have it move up a little bit just so we can make sure we get that Portfolio button down there. That's a pretty good position, -920 by -550 for the Y position and that's what I want to move the content_mc to.

So I'm going to open up my Actions panel that was currently nested. And I'm going to go to the video button and when it's clicked on, it's going to fire off this function and then just below the trace statement, you can type in 'content_mc' and then change, after I type that period, I can change the property of this movie clip and I want to change the x position. Okay, so this is going to be horizontally that it's going to move. So change the x position equal to -920, just like it shows right over here.

The y position, -550. New line, content_mc.y equals, again, don't forget the -550, just like that. So again, I'm going to click on this gray bar just to nest the Actions panel into that one bar and I'm going to go ahead and move this back into position. Now, I could kind of eyeball this, but what I'd like to do is use the Align panel. So I'm going to go to Window > Align and make sure this button is depressed, the To-stage button, and I want to center vertically and horizontally to make sure that is in its exact position.

Now, this is the starting point. So the John Doe button, it's the home button, and when you click on his name, I want to reset the position of the content_mc, back to this location, which is -600 x -752. So I'm going to remember those numbers because when I click on the home button, I want to adjust the x and y position of content_mc. Again, x position is going to be equal to -600 and content_mc's y position is going to be equal to -752.

Now, I'm just going to round that to a whole number, -752, and with the home button set up and the video button set up, it should work just fine. So I'm just going to go ahead and check syntax by clicking that check box and this script contains no errors. Now, let's go ahead and do the Control > Test Movie. I'll move this into place and now when I click on video, it pops, changes the x and y position, when I click on that video_btn and then for the home button, bam, snaps back into place.

So it's working quite well, and quite frankly, I can set up the other two now. So let's close this and go back into my code and I can start to add some of the code for the other buttons. So let's go ahead and minimize this Actions panel and what I want to do now is bring in the about section. Now the About section is actually going to rotate. So I need to do just kind of minimize, scoot this out of the way. I want to expand out this panel and I just want to be able to see the Transform panel, because what I need to do is I need to change the rotation of this content_mc.

And what I can do is is I can just go ahead and click and drag and I can see that rotate around. Now, you can use the Transform panel to, obviously, transform anything. I could even use, in my Tools panel, the Free Transform tool, in case I just kind of want to adjust it this way. But I think when you're dealing with code it's better to do it numerically, so that's why I'm going to use the Transform panel, just to rotate it a -90 degrees, just like that.

So I'll just position it into place. Use my arrow keys to fine-tune it like that. That's a pretty good position. All right. It's a -90 degrees is the rotation. The x and y position, and I'll just round this up, is going to be -250 and a positive 1430, just like that. All right. I'm going to remember those numbers and the 90 degrees when I open up my Actions panel and again, this is for the about button.

Make sure you're inside of this aboutClick function. So just before this closing curly brace, you can type in content_mc, move its x position to -250, its y position 1430, _mc rotation, well, I will just start to type in 'rotate.' Oh! Rotation, there it is. I can select it, hit return, and then make that equal to -90 degrees.

Now, there is an issue, because I'm dealing with rotation at this point and these other two are not rotating. In fact, I need to make sure the rotation gets set back to zero for these other two. So I'm just going to go ahead and copy this. I'm going to select it and copy that line of code and paste it right into the home button's function and I'm going to make sure the rotation gets set back to 0. Same thing for the video button, paste that in there, set the rotation back to 0.

All right. It's looking pretty good so far. In fact, I'm just going to go ahead and do the Portfolio button now as well. So let's see what that looks like. Portfolio button actually shifts over and is really going to be on the same y-axis, but the x axis is going to change. So I'm just going to position that accordingly, maybe use my arrow keys to fine tune it. In the Properties panel, maybe make it -1000 and then this is going to be 1450.

All right. So I'm going to open up my Actions panel for the Portfolio button and again, I can just copy all of the x and y rotation from a previous function and paste it in and start changing some of these numbers. As for the Portfolio button, it's going to move to the left -1000 and then the y is going to be 1450 and let's be aware that the rotation is still -90 degrees, so -90.

All right. Everything seems to be looking pretty good, but you never know until you test it. So I'll do a Control > Test Movie. And as you can see, I didn't move it back to its original place when I finished getting all my coordinates. So I can go ahead and fix that just by typing in 0 here. Change the Align panel. Change the Align horizontal center and the vertical center to reset it back to its original position.

Now, Control > Test Movie. It's in its original position. I'm going to go ahead and click About. I can see that it rotates and then moves the x and y position, and go to Video and I can even go to Portfolio. So it's looking pretty good so far. I can select any one of these and I can even reset back to the beginning, just like that, by clicking John Doe. So notice that as I select the button, it changes the properties for the content movie clip to reveal that section.

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