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

Creating a First Web Site with Flash CS4 Professional

Creating 3D tweens


From:

Creating a First Web Site with Flash CS4 Professional

with Paul Trani

Video: Creating 3D tweens

When you are using Flash you always want to think about what Flash is good at and use those features such as its ability to animate. And we do have some smooth animations between sections but when we get to our Portfolio section these images just load in like any other image. Not super sexy and that's what we want to do. We want to add some sexiness and really a 3D tween to bringing in these images.

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 First Web Site with Flash CS4 Professional
3h 8m Beginner Apr 15, 2009

Viewers: in countries Watching now:

Information on how to learn Flash is prevalent, but it can be frustrating to understand how to make an entire working web site using this unique technology. Here's a course that cuts through the clutter and offers practical tools for creating a dynamic web site, even for first-time developers. In Creating a First Web Site with Flash CS4 Professional, veteran Flash instructor Paul Trani simplifies the process of integrating animation, video, audio, and user interactivity to create a site that is dynamic and appealing. The goal of this hands-on workshop is to teach web site-building skills for today's demanding interactive industry. Exercise files accompany the course.

Topics include:
  • Manipulating images for the best results
  • Integrating assets from other Adobe products
  • Creating buttons with ActionScript
  • Embedding links to external web sites
  • Exploring text layouts
  • Customizing interactive contact forms
Subjects:
Web Web Design Projects
Software:
Flash Professional
Author:
Paul Trani

Creating 3D tweens

When you are using Flash you always want to think about what Flash is good at and use those features such as its ability to animate. And we do have some smooth animations between sections but when we get to our Portfolio section these images just load in like any other image. Not super sexy and that's what we want to do. We want to add some sexiness and really a 3D tween to bringing in these images.

So let me close that test file. Go to my Timeline. Let me double-click on this content movie clip and I'm going to scroll down to the Portfolio movie clip and double-click on it and that first layer is my ActionScript layer. If I select that first frame, I can then go open up my Actions panel. So here is all the code that's currently written and it's really making everything work and everything is looking great, but I want to add a tween to this.

So let me just hit Return a couple times to give myself some space. In fact, what I want to do is I want to listen for the completion of the load of this image. So this largeImageLoader is the loader component and I want to listen for the completion of any load. So let me just take this name and I'm going to right-click and copy it and I'll paste it just below, down here and I want to add an event listener to it.

I'm going to add an event listener. This listener is going to listen for an event and the event it's going to listen to is the COMPLETE event. There it is. It pops up in my code hint. I can hit Enter. It's going to listen for the complete of any image that's loading and once it does that, it's going to call the imageLoaded function. All right, function imageLoaded is what I need to code now. It's going to be an Event type. So it's not going to be a mouse event, just a regular event, and I'm going to had an open curly brace and a closing curly brace. Okay, so in this function, I'm going to have two lines of code. I'm going to have a trace that says image has been loaded, and then I'm going to another line of code.

But let's make sure this is working. All right, I'm going to go to Control > Test Movie. Portfolio section. Let me move down this Actions panel so we can take a look at our Output panel. When I click the next button, I should see images loaded and there it is. In fact, if I click it multiple times I'm going to see that printed out in my Output panel. So it is working and it's looking great.

Well, I want to add some cool tweens like I have with these other sections. I want to add a 3D tween. In fact, I'm going to use these tweens as an example or at least the starting point for my 3D tween. So I'm going to close my test file and what I want to do is I'm going to go out to Scene 1. And in Scene 1, if I go to my Timeline to that very first frame in the Actions/Labels layer, I can take a look at that code because I want to do the same thing. I want to add a very nice tween.

In fact, I'm just going to copy this tween format of moving the background. So I'm going to select it. I'm going to copy it and now I'm going to show you a nice shortcut because you have seen me bounce around and dig into different movie clips to access different ActionScript. When really what you have is you have all that available right here. You can see this is my navigator for ActionScript and it shows me everywhere where there is ActionScript and what I want to do is I want to go back into my Portfolio movie clip to the code there.

You can see this Code Navigator lets me jump right to that place as opposed to navigating through the Timeline like I was doing before. All right, I'm exactly where I want to be. In fact, I can close that just by hitting that arrow and open it as well that same way. But I'm going to nest that back on the side and I'm going to right-click and paste in the code I just copied. So what I want to do is I want to modify this tween call. I want to animate this largeImageLoader. In fact, I'll copy that name and replace the background and see with the instance largeImageLoader and instead of animating its X position, I'm going to type in rotationX. So it's going to rotate on an X-axis, flipping as if it was maybe something on a close line, forward and back is how it's going to work.

In fact, if I change Regular to Elastic, we'll get a nice bouncing effect there. And again, I want to replace this bkgd_mc with its starting point, which is going to be 90 degrees, and it's going to end up at 0 degrees. And if I ever need to remember what these different properties are, I can always come up here and show the code hint. So that's the finish point. So it's going to animate this from 90 degrees to 0 degrees. It's going to make it flat and it's going to do it over the course of two seconds.

All right, let's try this out. It should do it for every single image, each time one is loaded, it will call the trace statement and we'll animate it in. So let's go ahead and try this. Control > Test Movie. I'm getting an error and I know exactly what that is and I'm glad it came up because it's a call to a possibly undefined method tween. So this is an error you get if you use the tween class without importing the code that it uses.

So let me jump out and again, I'm going to use my Code Navigator to jump back to my main Timeline, that first frame. So that's the equivalent of going to the main Timeline clicking on that first frame and in here it says it's looking for this undefined method called Tween. And the reason it's asking for that is because that information is right here. So Flash is getting the code but it's only getting the code for everything on this current Timeline. So I need to copy this. Right-click, Copy.

Code Navigator, I'm going to jump back out into the Portfolio movie clip and right in here just above my function, I can right-click and paste in that code. Now because this is using the tween and this is using the easing. And I don't need this line but I'll keep it there. And I go to Control > Test Movie, click Portfolio. Now let's take a look at our tween and it swings in. A very nice look. It was one line of code, actually a total of three, but in general it's that one tween call that animates every single image swinging in, in a 3D fashion. Very nice, very sleek and very useful.

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


Expand all | Collapse all
Please wait...
Q: If I create a website using Flash CS4 on a Mac, can I edit it on a PC using Flash CS4?
A: As long the file is saved as a .FLA file with the extention ".fla" typed at the end of the filename when saving on a Mac, it should open with no problem on a PC.
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 First Web Site with Flash CS4 Professional.

Return to your organization's learning portal to continue training, or close this page.


OK

Course retiring soon

Creating a First Web Site with Flash CS4 Professional will be retired from the lynda.com library on April 24, 2014. Training videos and exercise files will no longer be available, but the course will still appear in your course history and certificates of completion.


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