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

Creating transitions

From: Creating a Portfolio Web Site Using Flash CS4 Professional

Video: Creating transitions

Flash does many things really well, but probably at the top of the list is its ability to animate, which is what I want to do with this site. I want to create some smooth transitions from one section to the next. Because currently what happens is if I click on a section, it's just a straight cut from where this navigation was, to the About section, and really I want it to animate. And what's great about Flash is I can build some Tweens, so it does all the in between frames. I don't have to move something frame by frame. I can just tell Flash, "Move it from point A to point B." And that's what I want to do, going from section to section, move it from point A to point B, just build out the Tween.

Creating transitions

Flash does many things really well, but probably at the top of the list is its ability to animate, which is what I want to do with this site. I want to create some smooth transitions from one section to the next. Because currently what happens is if I click on a section, it's just a straight cut from where this navigation was, to the About section, and really I want it to animate. And what's great about Flash is I can build some Tweens, so it does all the in between frames. I don't have to move something frame by frame. I can just tell Flash, "Move it from point A to point B." And that's what I want to do, going from section to section, move it from point A to point B, just build out the Tween.

So let's take a look at what I currently have, because in the Timeline I have my AS layer. I can select that first frame. And what I want to do is go to Window and open up the Actions panel. And if I scroll down, I see that I have all of my EventListeners that listen for a Click and then fire off this homeClick function, and then it just pops directly to this position, for instance, and rotates it as well.

So I want to really, ultimately replace these with some nice Tweens. So I am just going to move to the very top and just hit Return a couple of times, become I want to do a Tween, and I will just type in Tween. So this is the keyword you need to remember. It's a keyword in Flash, and you can select it, do a right-click, and then View the Help for Tween. Here is Flash's Help on the Tween class. It tells me what it does. Well, it lets you use ActionScript to move, resize, and fade movie clips by specifying a property of the target movie clip and then animate it over a number of frames or seconds.

So here's the code. I love it that they have given me some code as an example, but this is the code I need. There's some further notes in here, saying that there's some parameters that I need to modify. So I am going to just take this code, right- click, copy it, and then go back into Flash. Right here at the top, I am going to go ahead and paste this code. And now let me just explain what's going on, because these first two lines, these are import statements.

In general, this just TELLS FLASH TO IMPORT THE APPROPRIATE CODE to make this Tween work. So these two line tells Flash to import the appropriate code, and here is the Tween. So what this does is there is a variable called myTween, and what I want to do is I want to move the content movie clip when that button is selected. So the first thing I need to do is just cut this and move it to the correct spot.

So let's start with the about button. Inside of this aboutClick function, instead of it just popping directly to the x position, I want to add the Tween, so I am going to paste this Tween right in here. All right. I am just going to go ahead and type in 'Animate,' because that's what this is going to do. I want to animate the xTween, so I am going to change this variable to myxTween. And I need to define the Object to move content_mc.

I am going to change the x position. It's going to do this with elasticity, so it's going to be kind of like a rubber band. I can control this as well. And then I am given some numbers down here. And if you are ever curious as to what a parameter is, you can always put your cursor in there and then select Show code hint, and then that will tell you. Well, this is the begin point. Where do I want it to start from? I don't have an exact number I want to put in here, but wherever the content_mc is, wherever its x position is is where I want it to start.

So I am doing content_mc.x. And where I want it to end up is this point right here, -250. So I can take this, Command+C, copy it, paste it right in here. And this is going to happen. What is this last number? Well it's the duration. It's going to happen over the course of seconds, because this true means use seconds. Or I can say, "You now what? Animate it over the course of one second." All right.

There's myxTween variable, and I can go ahead and just Delete that property to change the position of the x, because now that I have this Tween, it's going to do all the work for me. So Control > Test Movie. I have just changed one property for the About section, so only one thing is going to move. If I click on it, did you see that bounce? Click on it again. It does that crazy bounce. I can do it multiple times, and I really only have one property that's being animated.

So let me just expand this out a little more so I can see this long line, but I want to do the same thing for these other two properties. So it's just a matter of copying this, Command+C, Command+V and changing what you need to change. So I am going to change the yTween, move the content movie clip, its why position, from wherever it currently is to this point right here. So again, I want to Command+C to copy that, Command+V, put that right in there, over the course of 1 second. All right.

Let's Copy this one again and let's do the rotation. myrotate, rotate the content_mc, rotation. Its current rotation position to -90 over the course of 1 second. Now that those are written, I can Delete that, and you did see the Elastic. You saw how it worked like a rubber band. Well, I am not particularly fond of that effect. I will just change this to Regular.

It's going to be a Regular easing, so it's going to be really smooth. And what easeOut means is when it reaches its resting point, it's going to slow down gradually. All right. It's looking pretty good. Now I am going to go ahead and Test my Movie, click on the About section, and that animates into place. Beautiful! Let's try it again, see it move into place. So I want to do the same thing for all the others, so I need to do this three more times.

So let's expand out this panel some more. So what I want to do is I want to copy all this code, Command+C, for the Home button inside of this function, so just before that closing curly brace, I just want to start replacing those numbers. So Command+C, or Ctrl+C if you are on a PC. I can start replacing these numbers, just like that. And don't forget to remove those first three lines, so we just have our Tweens in there, and that's looking pretty good. All right.

Let's Copy this again. For the video button, make sure you get the minus, or the negative, 920 x position, y position, and then the rotation is just going to be 0. And lastly, this Portfolio section -1000, 1450, and -90, just like that.

And remember, if you forget what these numbers are, just put your cursor in there and then click Show code hint and it will tell you, "Oh, this is the finished position." So keep that in mind. I will Delete these three lines. Everything is looking pretty good. In fact, I can go ahead and check syntax. It says the script contains no errors. That's great, but is everything going to line up and animate to the correct position? Well, let's check it out and see. Control > Test Movie. Click the About section, works great.

My Home button, it animates back into place, my Video button does a pop, which I need to fix, and then I have my Portfolio section, which animates up. So there is some weirdness that goes on. In fact, it looks like I still need to do -- aha, this is what you might run into, is that it pops directly there, and it's because I did not remove this code. So I just need to Delete that and then everything should be fine. So for the most part, everything is looking pretty good.

Control > Test Movie. And looks like I need to fix a couple of things, because this 'o' is getting cut off, and I want to point this out, because if you don't have items positioned on whole pixels, on whole numbers, then you might get this weird sort of cutting effect. So I want to go back in and make sure the position, the initial position of my content_mc is on a whole number, and that will alleviate this sort of cut right here, but I am really getting into the point where I am fine tuning this.

If I click on About, yeah, it rotates into place. This 'o' is getting cut off right there, so I might need to move its y position down some, so it fits in there fully. In fact, if I click on Portfolio, that looks a little more appropriate. Maybe I can scoot it over a little bit, and then if I click back here on the Home button, it navigates back into place. And as you can see, it navigates back into the center position, and it is on whole pixels, so that's why you don't see that being cut off.

So be aware of that. And what I am going to do is I am going to fix those two things: the About section, where it's sitting a little high, and then this Video, how that gets cut off a little bit. And I am going to minimize that Actions panel. I am going to select this content_mc, and if I look in the Properties panel, Position and Size, -599.15. Well, you know what? Let's just round that up to 600. In fact, this y position, 751.95. Let's just make it 750. We will start to get things sort of lined up just right, and that's kind of what happens even if you start to sort of scroll things back and forth, they get a little funky, but feel free to just type in exactly what you need.

And if I zoom in, Command+Plus, you can definitely see that everything is okay, so it's that positioning that's getting things a little weird. All right. Let's go back into the Timeline panel. I am going to select that first frame in the Actions layer, and I am going to look at the About button, and its y position, it was sitting a little high, so it's 1430. So to move it down I need to add to this number, so I might want to make that 1450. In fact, I can even compare that with the Portfolio section, because the Portfolio section is on the same y position, and that does say 1450.

So it's much more appropriate now, and I am going to go ahead and do a Test Movie, see the Video isn't getting cut off, that I can see the About section is in a better position, the same as the Portfolio section. And everything is positioned appropriately. I can even scoot this in a touch if I want to. But this really allows you to give you a sort of full control over the positioning of items, as well as just the animating of them, which just really adds just another dimension 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.