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

Applying professional transitions

From: Creating a Portfolio Web Site Using Flash CS4 Professional

Video: Applying professional transitions

So as you are developing but before you complete your site, you want to give your site a quick review just to see how everything is functioning, and currently, it seems to be functioning pretty well. I can click on the About section and what I do see is this content actually comes up before the transition finishes. Not only that, if I click on video, it does get stuck sometimes. And what's going on there is Flash is trying to do too much at once. It's trying to move this big background and then it's trying to load in this video.

Applying professional transitions

So as you are developing but before you complete your site, you want to give your site a quick review just to see how everything is functioning, and currently, it seems to be functioning pretty well. I can click on the About section and what I do see is this content actually comes up before the transition finishes. Not only that, if I click on video, it does get stuck sometimes. And what's going on there is Flash is trying to do too much at once. It's trying to move this big background and then it's trying to load in this video.

So I really want to have an orderly process for these transitions. So really, when the transition completes or the tween completes, that's when I want the content to load in. All right. So I have the index.fla file open and I am going to select that first frame there in the AS layer. I am going to open up my Actions panel and I am going to move this up a touch, and pin my code down there at the bottom, just by pressing that Pushpin. Now I can go ahead and take a look at this, because what's going on in is I have three tweens that are making this move and rotate, and I want these tweens to happen and then even finish before it loads into that particular section.

So I need to go ahead and implement a complete of the tween. So that's what I need to listen for. It's all about creating a new EventListener. I have my rotate tween. I am just going to copy that, Command+C, Command+V, because I want to listen for this tween variable. And I am going to add an EventListener to it. And what I am going to listen for is a TweenEvent, and I am going to listen for the MOTION_FINISH, so you can see all these various things, I can listen for.

I want to listen for the MOTION_FINISH. Select that, comma, and I can go ahead and type in donePlaying. That's going to be the function name that I am about to create. Okay, so the first thing I do before I even get into that function is I am going to make reference to this. I have this TweenEvent. Now this is actually a class that I need, so there is code that I need in order to make this work. So if I scroll up to the top, notice that I have imported tween, I have imported some easing, some other things, but I haven't imported that particular TweenEvent.

So I am going to type in import fl. transitions and I am going to type in TweenEvent. So I am telling Flash to go get all this code to make this MOTION_FINISH work. Now that that's done, I can create this donePlaying function. So function donePlaying, TweenEvent, the basic structure of a function, just like that.

Now I need to just move this sectionLoader.source right into this function. So I should have two curly braces down here. In fact, I'll remove that line. And again, what you are going to want to do anytime you add a function or add these curly braces is select the Autoformat button and it will line everything up. All right. It's looking pretty good. So when the rotation finishes, it's going to go ahead and fire off this donePlaying function. Let's do a Test Movie.

So if I click About, not until this rest into place, do I see this content. But let's take a look at the issue it brings up, because if I click another section, such as Video, that About content stays up until that Video content loads. So I need to remove content for a short period of time during this transition. So right up here in the same moveContent function below these trace statements, I need to go ahead and have a sectionLoader.source and I am going to make this equal to absolutely nothing.

So I'll just type a null. So this, all this is doing is kicking out anything that's in the sectionLoader, until the transition is done and then it will load in the appropriate content. So I am going to go to Control>Test Movie, in the About section, just like that, content loads in, if I click Video, this content should disappear, and sure enough, it does. So everything is working out pretty well.

This content loads in when the transition has finished. Notice it will also happen for the portfolio section. So again, establishing an order of priority for these transitions is really going to help the performance of your Flash website. And what I want to do next is even add some other transitions that are really going to bring my site to life. For instance, if I just replay this from the start, I'll just do a Test Movie, let's take a look at the background.

It just kind of appears. In fact, I see this flash of blue and then all of a sudden I'm hit with this pretty striking image. So I definitely want a smoother transition, as opposed to feeling like the user is getting slapped in the face, I am going to give it a little fade in. Okay, so right up here at the top, at least near the top, this is where I am loading in the random background, from one to ten. And I am just going to remove some of those line breaks, kind of nest everything together, because what I want to do is I want to load in that random image and once that image is loaded in, I want to go ahead and do a tween, just kind of like I am doing down here.

Okay, so again, it's going to be adding another EventListener. So you can see I'm really using EventListeners a lot here. I am going to type in background image and I am going to add an EventListener to this background, and I am going to listen for the Event.COMPLETE. So once the image is loaded in, once it's completed, I am going to type in fadeIn, because that's what I want to happen.

So that's going to be my function name, fadeIn, capital E for Event, just like that. Typical structure for a function and that's looking pretty good. So I'll even type in a comment. That's what I want to happen right here. When it's loaded, go ahead and fadeIn the image. So now that I have this function in place, I can go ahead and use a tween.

So I am going to use a similar tween to this. In fact, just to help me out, I am going to select this tween and I am going to copy it and paste it up here. Okay, so instead of myxTween, it's really going to be changing the Alpha. Alpha is the transparency of an item. So var myAlphaTween. Well, don't change the content_mc. Change the background mc. So I'll copy and paste that right in there, and alpha is the property I want to change, right down here, I don't want to refer to the position at all.

In fact, I want to refer to a number. I am going to start at zero. Zero means it's not visible at all. So it's 100% transparent. I want to go from totally transparent to opaque, which is 1. Now I might want varying degrees of transparency. So if I want this at about 80% and I kind of do because the background is pretty bright, well, I'll put .8 in there and that's the equivalent of doing 80%.

So that's looking pretty good. It is going to happen over the course of one second. So I am going to just click that gray bar to remove my Actions panel, nested up at the top. Another thing I want to do is I really don't want the background to be blue. What I need to do is just go ahead and change my Document properties. So I am going to Modify up to Documents and I am going to change the Background color because I always want this page to start on black.

So black is selected. I am going to select OK. Now if I expand open the Actions panel, that image is going to fade in as soon as the image gets loaded. So let's try this out. Test Movie. It fades in nice and smooth. I really like that. In fact, let's do it one more time. I can see it fade in. Now not only do you want to review and prioritize how your content gets loaded, you can also, obviously, add some very nice transitions to other content you'd like, such as the images in the portfolio section or maybe fade in the About section.

Either way, it really does add a nice professional look to your website.

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.