navigate site menu

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

Up and Running with Flash Professional

Up and Running with Flash Professional

with Anastasia McCune

 


In this course, author Anastasia McCune provides the basic building blocks a designer, even one who’s never touched Flash, needs to create animation projects or build a web presence. This course works for all Creative Suite versions of Flash and demonstrates how to create graphics, transform them to symbols, instantly move and morph objects with tweens, and incorporate text and audio. The final chapters address slightly more advanced topics such as adding links and play/pause controls to a project with ActionScript, as well as how to embed video into a Flash project.
Topics include:
  • Choosing the type of document to work with
  • Changing document settings and orientation
  • Importing bitmaps and vector files
  • Organizing layers
  • Understanding the timeline, frames, and keyframes
  • Creating shapes
  • Understanding the three symbol types (graphics, buttons, and movie clips)
  • Defining motion and shape tweens
  • Nesting timelines
  • Using effects and masks
  • Working with text
  • Importing and adding audio and video
  • Publishing your project

show more

author
Anastasia McCune
subject
Web
software
Flash Professional CS4, CS5, CS5.5
level
Beginner
duration
4h 7m
released
Mar 13, 2012

Share this course

Ready to join? get started


Keep up with news, tips, and latest courses.

submit Course details submit clicked more info

Please wait...

Search the closed captioning text for this course by entering the keyword you’d like to search, or browse the closed captioning text by selecting the chapter name below and choosing the video title you’d like to review.



Introduction
Welcome
00:04Hi! I am Anastasia McCune and welcome to Up and Running with Flash Professional.
00:09In this course we'll start with a blank slate and go through the fundamentals of
00:12creating a simple yet effective Flash project.
00:16I'll start by showing you how to navigate around Flash and utilize parts of the
00:20workspace like the Stage, Library, and Timeline.
00:23Then I'll show you how to import artwork into Flash as well as create your own
00:27using some of the drawing tools.
00:29I'll show you how to create simple animation by using Motion and Shape tweens.
00:34We'll also see how to incorporate audio and video as well as interactive control
00:39using items like buttons and simple ActionScript.
00:42We'll be covering all these features plus plenty of other tools and techniques.
00:46So let's get up and running with Flash Professional.
Collapse this transcript
Using the exercise files
00:00If you're a premium member of the lynda.com Online Training Library, or if you're
00:05watching this tutorial on a DVD-ROM, you have access to the Exercise Files used
00:09throughout this title.
00:11Many of the exercises in the course builds on previous lessons, but some do not.
00:16In both cases there is a folder for each unit of the course where we're
00:19building something.
00:21Inside each folder is a start folder and then an end folder.
00:25The start folder shows what the project looks like at the start of that tutorial
00:29and provides any additional assets you may need.
00:32The end folder shows what the end state of the project looks like if you follow
00:36all of the steps that I show you.
00:38If you're a monthly member or an annual member of lynda.com, you don't have
00:42access to the Exercise Files, but you can follow along from scratch with your own assets.
00:47I'm ready to go, so if you are too, let's get started.
Collapse this transcript
Viewing the finished project
00:00For this course much of our activity is going to be building towards the final
00:03piece, let's take a look at that piece now.
00:06Find fastCar.swf in the Exercise Files for this chapter.
00:11To prepare you ahead of time there will be a four second introductory scene with
00:15an animated title and a lady in a red car inspired by a famous 1960s song.
00:20Be prepared for some sound right off the bat and now I'll double-click to open.
00:24(video playing)
00:28After the initial four seconds we come to another scene where the lady in the
00:31car drives from right to left.
00:33When she's done crossing the screen she starts over. You'll see, of course, the
00:37text on the upper left that loops as she drives by.
00:40Notice also the sun in the upper right-hand corner, the yellow points on the sun
00:44slowly grow and shrink.
00:46The buttons across the bottom do just what they say. When you click "stop," the
00:50car stops and honks. (video playing)
00:54When you click "go," the car starts up again with tires squealing.
00:57(video playing)
01:00"Start over" has the lady rewinding to the right side of the screen and the text
01:05returning to the first phrase in the sequence.
01:10Finally when you click "buy action figure," Amazon.com opens up in a Browser
01:14window, so you can buy a lady and the car of your very own.
01:19Except not quite. You'll probably get this security setting warning, this is
01:23expected and we have to adjust some security settings to get rid of this.
01:29To build this project we'll introduce a wide range of Flash fundamental skills
01:33that you'll use over-and-over in your Flash career.
01:35We'll also build some other smaller files that aren't related to this car
01:39project to demonstrate additional topics like video.
01:42So sit back and let's get started.
Collapse this transcript
Setting up local file permissions for Flash Player
00:00When using the Exercise Files for this course, or when developing and testing
00:04your own projects, you may run into some issues with the Flash security.
00:08Flash player doesn't like it when Flash files on your local hard drive try to
00:12communicate with the Internet.
00:13While this helps prevent personal data from your computer being transmitted
00:18without your consent, it can really get in the way when you're testing
00:21Flash applications.
00:22The best way to get around this is to specifically tell your Flash Player which
00:26files on your local computer you trust.
00:29This is done in the Flash Player Settings Manager, which you can access
00:33whenever the Flash player sees a local Flash file trying to communicate with the Internet.
00:38To adjust the settings for this course, I'm going to open the file called
00:42fastCar.swf movie in the Exercise Files for this chapter.
00:46(video playing)
00:51When I click on "buy action figure," I get a dialog box telling me Flash Player has
00:56stopped a potentially unsafe operation.
00:58What we need to do is add the location of our exercise files to our list
01:02of trusted locations.
01:04This will tell Flash Player these files are okay and allow us to test without
01:08giving a security error.
01:10To do this I'm going to click Settings.
01:12I'm using Flash CS 5.5 and the interface for the process looks a little
01:16different from here on out with previous versions of Flash, but if you follow
01:20along in this tutorial you'll see what we're trying to accomplish and can likely
01:24figure it out for your version of Flash.
01:26Clicking on Settings brings up the Flash Player Settings Manager.
01:30Here I'm going to click on the Advanced tab and then click the Trusted
01:33Location Settings button.
01:35On the resulting screen I'm going to choose to Add and we'll choose Add Folder
01:39as we want to add all the exercise files for the course.
01:43Adding the whole folder will tell Flash Player that we trust all the
01:46files inside the folder.
01:48So browse to the location where you've downloaded your exercise files, I have
01:51mine here on my Desktop, select the folder and click Confirm.
01:57As you can see that folder has been added to our trusted locations and now
02:01you'll be able to test the exercise files locally without running into
02:04security errors.
Collapse this transcript
1. The Basics of Flash
Introducing the Flash application and Flash movies
00:00People throw the term Flash around a lot which makes sense as Flash is used in
00:05so many places in the digital world.
00:07However, there are some important distinctions to understand between Flash, the
00:10authoring tool, and the end products it can create.
00:14Let's take a look at those differences now so you can speak with authority about it.
00:18Let's first talk about Flash, the authoring tool.
00:20This is of course a piece of software that you purchase and install on your
00:23computer, and is what you're watching this course to find out about.
00:27Here on my screen I've already got the Flash software opened and it is showing
00:30what's called the Start Page.
00:32I'm going to create a new Flash document as if I was going to build a project by
00:36clicking on ActionScript 3.0.
00:38Don't worry about the other types of documents there;
00:40we'll go over them later.
00:42For now, click on ActionScript 3.0 and Flash opens up a new blank document.
00:47So this will be our source Flash file.
00:49This is our authoring document where we'll create all of our content and animation.
00:54In Flash, the source document has an extension of .fla.
00:58So if you go to File, and then Save As, you can save your document.
01:02I'll give mine the name of Test, and of course now, we have test.fla.
01:08So let's say we've added all our nifty content here, and it's zooming around,
01:11and we want to test it out.
01:13If you hit Command or Ctrl+Enter on your keyboard, Flash publishes your FLA file
01:18into a format ready for the world.
01:20Of course, there's not much to see in our blank file, but at least we have our
01:23published file called test.swf or Swiff;
01:28SWF stands for Shockwave Flash, Shockwave being a name from kind of the early
01:32history of the Flash program.
01:34You can publish your SWF file as much as you want as you develop your project
01:37for testing and preview purposes.
01:39When you're ready to deploy it to a website, the final SWF file is the actual
01:44thing that you would upload onto your server.
01:46We'll talk more about how you actually embed your SWF file into an HTML in the
01:50section about publishing.
01:52But, for now, conceptually, now we've jumped from Flash, the authoring tool, to
01:56Flash, the SWF file, which is what you deploy onto the Web or into the world
02:00for users to look at.
02:01So, say your SWF file is up on your website for someone to actually be able to
02:05view the SWF on their computer in a browser on the Web, their browser has to
02:09have the Flash Player plugin installed.
02:11The SWF file won't play in a browser unless the plugin is installed.
02:15One really nice thing is that for most people, they already have some version of
02:19the Flash Player installed.
02:21It's come bundled with Internet Explorer for years.
02:23I'll prove to you that most people already have the Flash Player, look at
02:27this page on adobe.com.
02:29You can take some time to look over these charts, but the thing I want to point
02:32out here quickly is how Flash Player 10 as of June 2011 was on 98.7% of
02:39computers in mature markets.
02:41You can also see how newer versions of the player are adopted pretty quickly over time.
02:45For instance, version 10.2 had 45.8% adoption in March 2011, and by June was up to 77.8%.
02:54This is a big advantage, since you know that your content is going to be able to
02:58be viewed by a lot of people.
03:00Have you ever viewed a website and seen a message telling you that you need the
03:03most recent version of the Flash Player to view the content?
03:06This and other methods are how the most updated versions of the player get adopted.
03:11So you as the developer can choose what version of the Flash Player you want to
03:15target when publishing your SWF, and you should research your audience.
03:18For instance, if your audience is a group within a corporation that has a
03:22tightly controlled IT environment, you might not want to choose the very latest
03:26version of the player.
03:27You should choose whatever version the company is using.
03:29There's nothing wrong with targeting a slightly older version of the player to
03:33best suit your audience.
03:34Another reason Flash is a good choice for delivering content on the Web is that
03:38Flash content looks the same across all browsers.
03:42Have you ever built something in HTML, tested it in Internet Explorer, Firefox,
03:46and Safari, and noticed that it looks different across all three browsers?
03:50That doesn't happen with Flash.
03:52You aren't targeting a browser with your SWF, you're targeting the player.
03:55And as long as someone has the Flash Player installed, your content is going to look good.
03:59This is one reason Flash content is deployed in so many places across the Web.
04:04Flash makes it really easy for video to go on the Web, and look good on all browsers.
04:08And if you go to YouTube, pick any video, and right-click on the video.
04:12You'll see right there, you have the option to see about the Flash 10.2 Player.
04:17Content in the Flash Player always has that little About the Flash Player option
04:21when you right-click on it.
04:23You may or may not have all the other options shown here, but you'll always
04:26have those bottom three;
04:27Settings, Global Settings, and About Adobe Flash Player 10.2. So you might be
04:32thinking, okay, great!
04:33This is true for the Web when you're looking at a Flash SWF file from a computer
04:37with a browser, but how about mobile and tablets?
04:40If you're an Android user, you're pretty much okay, but if you have an iPhone,
04:44you've probably noticed that Flash content doesn't play through a Web browser.
04:48This is more of a policy decision than a technological limitation, but the fact
04:52is that if you want to build for users, purely on a mobile platform, you should
04:55consider that, and maybe even use something else besides Flash.
04:58That being said, let's make a distinction here.
05:01Say you've used your iPhone to buy an app from the Apple App Store. The content
05:05very well could have been developed and deployed in Flash.
05:08But, this isn't a SWF like viewed through a Web browser, this Flash content is
05:12being published through the Adobe AIR platform.
05:15If you want to publish a straight SWF file to be viewed on the Web through the
05:18browser, this video training is the right place to be to learn the
05:21fundamentals of Flash.
05:22If you want to build things that will ultimately deploy an AIR project, maybe
05:26as an app to be sold in the Android or Apple stores or a program you want
05:29people to be able to physically install in their computer, this is also a good place to be.
05:33The fundamentals of authoring in Flash presented here pertain in both cases.
05:38That being said, also note that there are other courses here in the lynda.com
05:41Online Training Library that focus specifically on AIR and developing Flash for
05:46mobile in particular to help you with those topics.
05:49So with that, I think we're ready to move on with our journey with Flash.
Collapse this transcript
Using Flash instead of HTML to build a web presence
00:00Flash and HTML are both powerful tools for building a web presence.
00:04They can work independently or together, so let's take a look at how they interact.
00:09In my Exercise Files, I've opened up the file called fastLittleCars.html in a browser.
00:15It's a very simple webpage for the fictional website Fast Little Cars.com.
00:19As you can see, it's just got a header image, some fake navigation links on the
00:23left, and some text.
00:25Now, let's say I want to add a Flash piece to my website, maybe an animation, a
00:29game or something else pertinent to my site.
00:31Let's say we want to add the completed version of the project for this course;
00:35the piece called Fast Car that has a little old lady driving a red car to the webpage.
00:40As I just showed you in the previous movie, the final published output from
00:44Flash is a SWF file.
00:45To have the Flash SWF appear on my page, I have to embed the SWF into my HTML.
00:51(video playing)
00:56And if you open up fastLittleCarsWithFlash. html, you can see that's exactly what we've got.
01:02We have our original HTML page, but this time with the fastCar.swf Flash
01:06file embedded within it.
01:08The embedding is achieved through some special HTML code that points the
01:12HTML file to the SWF.
01:14In this case, looking at our folder structure of our computer, we can see that
01:17the SWF file is in the same directory as the HTML file.
01:21Your SWF and HTML files can be in different directories as long as you give the
01:25HTML embedding code the correct path to the SWF.
01:28Flash can generate the embedding code for you and we'll look at how to do that
01:32in the section about publishing.
01:33For now, it's enough to know that it's common for websites to be built mostly in
01:37HTML or as PHP pages or ASP pages or whatever, and have Flash SWFs embedded in
01:43one or multiple spots throughout, as appropriate.
01:46In this case, it's easy to tell the borders of the SWF file.
01:48But remember, you can always find out if a piece of content on a page is Flash
01:53by right-clicking on it.
01:54If you see the words About Adobe Flash Player and then the version number, you
01:58know you're looking at something that's Flash.
02:00Surely, you've seen some sites that are built totally in Flash.
02:03They are not that different than what we've just seen.
02:05We're still embedding a SWF onto an HTML page.
02:08For example, if you open up flashVersion.html from your Exercise Files, you'll
02:14see pretty much the same website we saw as before.
02:16The only difference is that this time, the HTML exists simply to embed the Flash
02:21file called FlashVersion.swf.
02:22The SWF has a very large visual dimension, all the content that appeared as
02:27HTML before is now part of the SWF file, and we had a few extra zooming effects going on too.
02:32The background color of the HTML has been changed.
02:34So you can see the edges of the white SWF, but clearly, all of the site's
02:38content is contained in the SWF.
02:40Now, it wouldn't provide much of an advantage to build a simple text heavy site
02:44in Flash if something like animation isn't going to be part of the picture.
02:48Likewise, a site needing to show animation or a neat interface for maybe a video
02:52player, might be really well- suited to be part, or all Flash.
02:56There is no right or wrong regarding if you build your site as all HTML,
02:59all Flash, or a hybrid.
03:01You should pick what makes the most sense for you considering things like what
03:05your project needs to convey, who will be maintaining the site, and what skills
03:08they have and so on.
03:10So Flash and HTML can interact as much or as little as you wish.
03:14Your entire site can be made in Flash or your site can be HTML-based with
03:18smaller Flash pieces embedded within it.
03:20The easy part is writing the embed code for your HTML, because Flash can do that
03:25for you when you create the SWF.
03:26Most of your time will be spent developing your content.
03:29So let's get started with that.
Collapse this transcript
Understanding how ActionScript fits into Flash
00:00You've probably heard that ActionScript is an important component of Flash.
00:04It is, but I'm here to tell you that you don't need to know a lot of
00:07ActionScript to be able to create some pretty cool functional Flash pieces.
00:12However, it won't take long until you get to the point where you do need to know a few things.
00:15So we'll cover some very basic ActionScript in this course.
00:18Let's take a quick look at some common places were ActionScript is used to get
00:22an idea of how it will fit into our learning.
00:25Let's start with some places where you don't need ActionScript.
00:28If you open the file called noActionScript.swf in your Exercise files, you'll
00:33see images and text from our Uncle Chris' vacation, simply appearing and then
00:37disappearing on the screen.
00:39You just place those images on what's called the stage in Flash and they appear.
00:42No ActionScript is required.
00:44Similarly, animation doesn't require ActionScript.
00:47Now, I'm going to open alsoNoActionScript.swf from our Exercise files.
00:53The simple motion of the rocket going across the screen, and the moon rising
00:56requires no ActionScript.
00:58Even the simple syncing of the Moon's mouth with the words is created on what's
01:02called the timeline, without ActionScript again.
01:05Now, I'm going to open lynda_biker_banner.swf.
01:10The animation in this piece is more complex and very nice with the motion of the
01:14biker's legs, her hair blowing in the wind, and the changing perspective of the
01:17bridge and landscape as she rides.
01:19But again, none of that was ActionScript-based.
01:22It's all just well-done graphics, animated on the Flash timeline.
01:25needsActionScript.swf shows some common things that need ActionScript to work.
01:30For instance, a button responding, the Click Me button can be on the screen, but
01:35without ActionScript, nothing actually happens when you push it.
01:38In this case, ActionScript is listening for the button to be pushed.
01:42When it is, it displays the rocket in response to the click.
01:45Opening a new window in response to user action also needs ActionScript, just
01:49like when I click the Shop Now button.
01:52Now, if you get a warning when you click the Shop Now button, you need to adjust
01:56your security settings which we talk about in a previous movie.
01:59Counting and math also uses ActionScript.
02:01You can see that the left box is perpetually counting upward and the right box
02:05is perpetually adding 1 to the value in the left box.
02:08Actually, outputting those numerical values to the screen also
02:12requires ActionScript.
02:13Our last example shows taking in user input, again in the form of a button click.
02:18But, we could also ask for someone to input their name, number, or email address
02:21for use in our application.
02:23So if I click Yes, I ate my dinner, I get to have some dessert.
02:26If I say No, I didn't eat my dinner, I have to eat five more bites.
02:30So you can see that getting to the point of needing ActionScript will likely
02:34come relatively soon for you.
02:35As soon as you want the user to be able to interact with your movie, not just
02:39watch it, you need script.
02:41There's a great tool in Flash called Code Snippets.
02:43It writes ActionScript for you and it's a great place to start learning and is
02:47what we will be using in this course.
Collapse this transcript
2. Introducing the Workspace
Choosing the type of document to work with
00:00So we're ready to start working in Flash.
00:02I've already launched Flash and we're looking at what's called the Start Screen.
00:06Right here in the center of this screen is where we create new blank Flash files.
00:10It might look kind of confusing at first because you're presented with what
00:13looks like a bunch of different kinds of files to choose from, but they're
00:17really not that different at all.
00:18Regardless of which option you choose, you're going to end up with a new blank
00:23unnamed source.fla document.
00:25The only real difference between these choices is having Flash set up some
00:28options about the final outputted SWF for you.
00:32I'll demonstrate this by choosing the first option at the top that
00:34says ActionScript 3.0.
00:37Our new document is created, and right- away let's go to the File menu and scroll
00:41down to select Publish Settings.
00:43The Publish Settings dialog box appears and here on this first screen we can see
00:48that when the FLA is published it will create a SWF file and an HTML file,
00:52because both of those boxes are checked.
00:54You can switch back and forth between the settings for these two by clicking on the title.
00:59I'm using Flash CS 5.5, and this interface looks a little bit different from
01:03previous versions of Flash, but you can still switch back and forth between the
01:07different screens for the different type of output files.
01:10On the SWF screen, here at the top, you can see that the final outputted SWF
01:14will target Flash Player 10.2 for the player and use ActionScript 3.0.
01:19You can open up the Player dropdown to see the other options.
01:22You could target your SWF to play on older versions of the Flash Player if you
01:26wanted, Adobe AIR, iOS, Flash Lite, and some other options.
01:30Flash Lite is a special kind of player for mobile devices.
01:33Likewise, if you pull down the Script dropdown you can see that you could
01:37specify that your SWF is going to use ActionScript 1, 2 or 3.
01:41Even if you never write a single line of ActionScript code in your project, you
01:45still have to tell Flash what version of ActionScript you want to target.
01:48Now I'm going to hit Cancel to close the Publish Settings box and close out of
01:52this document to return to the start page.
01:54This time I'm going to click on ActionScript 2.0 to open a blank document.
01:59Let's once again go to the File menu and then choose Publish Settings.
02:03On the Flash screen you can see that this time our Publish SWF is going to
02:07target Flash Player 10.2 but this time use ActionScript 2.0 instead of 3.0, and
02:13really that's the only difference between this blank file and the one we
02:16created just a moment ago.
02:18Flash is just setting these options for you ahead of time.
02:21Let's go ahead and get back to the start page.
02:24The next option is for Adobe AIR, iPhone OS, and Flash Lite are similar to
02:29what we've already seen.
02:30You get a blank FLA document and then the appropriate settings are
02:33pre-selected for you.
02:35The choice out of all these that you likely use the most, especially if
02:38developing for the Web is ActionScript 3.0.
02:41Regarding ActionScripts 2 versus 3; you probably wouldn't want to use anything
02:46other than ActionScript 3 since it's the most recent and robust version of
02:50ActionScript unless you have a specific reason.
02:52For instance, if you're updating or working with an older Flash piece that was
02:56built-in ActionScript 2, you'd probably just want to stick with ActionScript 2.
03:00ActionScript 2 and 3 can talk to each other but they are different in some
03:04significant ways and it's not exactly easy.
03:07For any new kind of project you're building from scratch ActionScript 3 is
03:11what you should choose.
03:12Let's click on the choice of ActionScript file this opens another blank document.
03:17And if you go to File and Save As you'll see that instead of being a .FLA this
03:22is a .AS file, the AS stands for ActionScript.
03:26This is an external ActionScript file.
03:29Using external ActionScript files is probably not something you'll work
03:32with until you become proficient with ActionScript, so let's just close this document.
03:37The same could be said for the Flash JavaScript, ActionScript 3.0 Class and
03:41ActionScript 3.0 interface choices.
03:44You probably won't use them until you're proficient with ActionScript.
03:47If you've programmed in other languages like C++ or Java before, you'll be glad
03:51to know that ActionScript is also a robust object-oriented language.
03:55Everything else on the start page here is mostly for your reference.
03:59The choices down in the right-hand side lead to tutorials and help articles
04:02about various topics in Flash.
04:04The lower-left shows a clickable history of FLA files that you've worked on and
04:08the templates are just like they sound, simple templates for different types of
04:12commonly built projects.
04:14Picking them apart can be a good way to pick up new ideas on how to construct
04:18things in Flash, especially the ones in the Animation and Sample Files sections.
04:22That's all for now, but we've seen pretty much all the possible starting points
04:26for starting a Flash project.
04:27We've also seen where to access the Publish Settings for a project if you need
04:31to change what player or version of ActionScript you're targeting down the line.
Collapse this transcript
Understanding document settings and orientation
00:00Let's start getting familiar with the workspace in Flash.
00:03So I'm going to start by opening up a blank ActionScript 3.0 document and taking
00:08a look at a few important settings.
00:10The first thing you probably notice in your screen is the big blank rectangle in the middle.
00:14In Flash, this is known as the stage, and this is where you will place all your
00:17content for your Flash movie.
00:19You can place content on the screen, but off the stage if you wish.
00:22The area around the stage is known as the pasteboard, and for an example, I'm
00:26going to select my Rectangle Tool and quickly draw a rectangle half on the stage
00:30and half on the pasteboard.
00:32To preview your SWF file, press Command or Ctrl and then enter on your keyboard;
00:37this way you can preview what the finished product would look like, and as you
00:40can see, we only see half of the rectangle.
00:42So while it's okay to put things onto the pasteboard, if you want your content
00:46to appear in your final finished SWF file, it has to be on the stage.
00:50Starting visual objects off-screen on the pasteboard can be a good way to create
00:54an effect like a car driving on screen.
00:56I am going to close the SWF file.
00:58There are a few ways to zoom in and out on the stage;
01:01I'd like to use hotkeys to zoom in and out.
01:03Press Command or Ctrl and then the plus sign (+) at the same time to zoom in and
01:08then Command or Ctrl and then the minus sign (-) to zoom out.
01:11Another good option for zooming is the handy Zoom Tool over on your toolbar.
01:15Once you've selected the tool, near the bottom in the Options area, you can
01:19choose Enlarge to zoom in or Reduce to zoom out.
01:22I'm going to choose Enlarge again and note that you can also click and drag
01:27to zoom in on a particular spot in the stage so you can work in detail on your content.
01:31Finally, you can use the Zoom dropdown menu on the upper-right to choose a
01:36percentage to zoom in or out, too.
01:38Notice also that you have little scroll handles to scroll right and left or up
01:42and down, if you need to re-center your imagery after you've zoomed in and out.
01:46Show Frame under the dropdown menu up top is also a good one for
01:49easily re-centering.
01:51Another way to easily move around to different parts of your stage is by
01:54using the Hand tool.
01:56Just grab the Hand tool from the toolbar and then click and drag the stage to move it around.
02:00You can see that I'm not moving my rectangle;
02:02I'm just moving my view of the stage.
02:04If you like the Hand tool as a way to move things around, you might like
02:08this keyboard shortcut.
02:09Make sure you've selected your Selection tool or the Arrow tool, and then with
02:13the arrow over the stage press the Spacebar on the keyboard.
02:16As long as you've got the Spacebar press down, the Hand tool will be activated.
02:20Rulers are a super useful tool you've probably seen in other softwares and
02:23Flash has them too.
02:25To turn the Rulers on, go to the View menu and choose Rulers.
02:29You'll notice that the increment on the Ruler is pixels and the origin point for
02:33this stage is measured from the upper left-hand corner.
02:35In Flash, the x-axis goes horizontally, starting at 0 at the upper left-hand
02:41corner and going across the top of the stage.
02:43The y-axis also starts at 0 at the upper left-hand corner and goes down the
02:48left-hand side of the stage.
02:49I'm going to choose my Arrow tool and then click and drag to draw a little
02:53box around the rectangle to select it, and now move it over so it's fully on the stage.
02:58The position of an object on the stage is also measured from the upper-left
03:02corner of the selected object.
03:04So looking at the upper left-hand corner of the rectangle relative to the
03:08rulers, you can see that the x-position is almost 200, maybe 175, and the y is about 140.
03:17If you want to know what it is exactly, just select the object and open up
03:21what's called the Properties panel over here on the right.
03:24It tells you the exact X and Y position.
03:27To further help you line things up on your stage, you might like to use guides.
03:31To create a guideline, first click on the stage to make sure you've
03:34deselected the rectangle.
03:35Now click and hold on either one of the rulers and drag a guide out.
03:39You can create as many guides as you wish and you can also reposition them by
03:43simply clicking and dragging them to a new location with your mouse.
03:47You could also double-click on a guide and type in the location you want it to have.
03:51Guides are only a tool for you, as the developer.
03:54If you've published your movie, you'll see that the guides don't appear in the published SWF.
03:57I am going to close my SWF and go back.
04:00If you want to lock your guides in place so you don't accidentally move them,
04:03you can go to the View menu then Guides then Lock Guides.
04:08You can see I can't move my guides at all, but now I actually want to get rid of
04:11one so I'm going to go and unlock them again.
04:15To get rid of a guide, simply drag the guide back onto the ruler.
04:18Alternatively, you could go to the View menu, then Guides and Clear Guides to
04:23get rid of all of them at once.
04:24To set the properties for your document like background color and size, simply
04:29click on the stage, being sure not to click on your rectangle.
04:32Look over in the Properties panel and you'll see some controls like the
04:35stage size right here.
04:37For instance, you can see that our current stage dimensions are 550 x 400.
04:40I'm going to click on the Edit button to open the Document Settings.
04:45In Flash CS 5.5, the Edit button looks like a wrench, in other versions,
04:49it simply says Edit.
04:51Some of the items we saw on the Properties panel are repeated here.
04:54For instance, we can see the stage dimensions and change them by typing in new
04:58ones, for example 640 x 480.
05:01The settings you'll most likely be interested in are where you can change the
05:04units of the rulers to inches, centimeters, or other choices.
05:09You can also set the background color of your document here.
05:11You've probably also noticed the frames per second and you can see that it's
05:15currently set to 24.
05:17This affects how fast or slow your Flash movie is going to play.
05:20We'll go into a more detailed discussion of this soon, but for now, know that
05:24setting this to somewhere between 12 and 30 is generally considered acceptable,
05:28and the default of 24 is just fine.
05:31And of course, if you want Flash to auto-save all your hard work for you, you
05:34can check this box and specify how often it should save for you.
05:38If the settings you create here are what you want all new Flash documents to
05:41use, you can click Make Default.
05:43I'm going to cancel out of this box for now because our current settings are
05:47fine for our purposes.
05:48The final thing to note about your stage properties is in this little area
05:52labeled SWF History.
05:54We've published our movie already, and this area handily shows you the size
05:58of that published SWF.
05:59Let's go ahead and delete our rectangle from the stage by drawing a box around
06:02it with the arrow and then hitting Delete on the keyboard.
06:05Now let's hit Command or Ctrl+Enter one more time to publish our now blank SWF.
06:10Close the SWF and notice that the file size went down a little bit since we
06:14deleted the rectangle.
06:15These are the basics that you need to know about setting up the basic properties
06:19for your Flash movie.
06:20Remember that you can change them any time by clicking on the stage or the
06:24pasteboard, and then looking in the Property Inspector.
Collapse this transcript
Touring the workspace
00:00With a blank ActionScript 3.0 FLA file open, let's further explore the
00:05Flash interface so we can navigate around and make good use of all the tools available.
00:10We've already identified the blank rectangle in the middle of our screen as the
00:13stage and it's like a canvas where we'll put all of our Flash content.
00:17Above the stage, across the top of the screen, are all the menus for Flash.
00:21The File menu has items familiar to pretty much any computer user like New to
00:26create a new document, Open, Save, Save As, and so on.
00:30We'll explore some of the other menus as we need them throughout the course.
00:34If all your Flash settings are the defaults like mine, below the stage,
00:38you'll find the Timeline.
00:39Anything that's going to appear on your stage is also going to appear in the Timeline.
00:43A Flash movie plays in a linear fashion.
00:45The Timeline helps you control at what point in linear time your items will
00:49appear and for how long.
00:51We'll practice using the Timeline in detail in a separate video, but for now,
00:54know that the Timeline will be an integral part of the setup of all your Flash movies.
00:58If you click on the stage or the pasteboard with your Arrow Tool and look to the
01:02right, you'll see the Properties Panel which tells you information about
01:05whatever item you've clicked on.
01:07We can see our Flash movie here has the default frames per second, or FPS, of 24,
01:12a background color of white, and a stage dimension of 550x400.
01:17Move your mouse over to the right, over the very skinny panel, that's the toolbar.
01:22Here's where all your drawing tools are kept and let's click on our Rectangle tool.
01:26When you do, you'll notice that two places on the screen change.
01:29First of all, the Properties panel shows you the different settings that you can
01:32set for the rectangle you're about to draw.
01:35Secondly, below all the drawing tools, there are some other settings like Fill
01:39Color and Outline Color.
01:40Click on several other of the tools in the toolbar like the Text tool, the Line
01:44tool, and the Pencil tool, and you'll see that the Properties panel and the
01:47area below the toolbar change depending on what options are available for that particular tool.
01:53Let's choose our rectangle again and change our settings and draw our shape.
01:57So let's change the Fill to be black and the Outline, which is known as the
02:01Stroke in Flash, to red.
02:03Let's make the stroke thicker by either moving the slider or typing 4 in the box.
02:07Let's make our Stroke a Dashed line and then bump up the number under
02:11Rectangle Options to 10.
02:13The higher the number, the more rounded our rectangle's corners will be.
02:16Let's draw a rectangle on the stage.
02:20After it appears, go back over to your Tools panel and select the Arrow tool.
02:24Now if you double-click on your black rectangle, notice that the Properties
02:28panel changes again, now telling you information about the shape you selected on the stage.
02:33For instance, it tells you that the Width is about 223 pixels, the Height is
02:37145, the X-position is 160, and the Y is 105.
02:42It also shows you the settings you chose for the Style, for the Fill, and the Stroke.
02:47If you move your rectangle with your Arrow tool, notice that the X and Y
02:51position are automatically updated in the Property Inspector.
02:54You can also go and change, say for instance, the stroke from a dashed line to
02:59another kind of line.
03:00You can see that the Properties Panel is a pretty important panel.
03:03You'll use it constantly to check and update settings for items on your stage.
03:07Go ahead and click on the Library tab now to open the Library panel.
03:12It's empty right now, but this is a place where you're going to keep copies of
03:15different items that you use in your Flash movie and it will become very
03:19important down the line.
03:20I am going to click on the pasteboard to deselect my rectangle and now let's
03:23work with the panels a little bit more.
03:25They're designed to be moved around to best suit your workflow.
03:28You can expand and contract panels by clicking on the little double arrow at
03:32the top of each panel.
03:33For instance, I can contract and expand the Library and Properties panel.
03:37Likewise, I can expand this panel set to reveal the Color, Swatches, Align,
03:42Info, and Transform panels.
03:44When the panel set is open, click the little context menu on the upper right to
03:49see different additional options available for that panel.
03:52So, for instance, for the Swatches panel, I can duplicate a swatch, delete a
03:56swatch, add colors, and so on.
03:58You can also change where an entire panel group is docked.
04:01Let's close our color group and see this little dotted area at the top right here.
04:06If you click and drag that, you can move the whole panel, say, over to the left.
04:10Hover over the left side of the screen for a moment and you'll see a blue
04:13outline and a gray shade pop-up which is the new spot that you can dock your panel into.
04:18Try clicking on the gray bar next to the Timeline and the Motion Editor and I
04:21can drag this panel up to the top.
04:23Wait for the little blue line and then dock them at the top.
04:27You can also do something like pull the toolbar out and have it just float
04:30above everything else.
04:31You can change the panel layout as much as you wish.
04:34If you move something somewhere you don't like and you can't get it unstuck,
04:38you can always go to the dropdown at the upper right of the screen that says Essentials.
04:42If you choose Reset Essentials, your panel layout will return to the default
04:45layout you see when you open Flash.
04:47You can also check out some of the other preset layouts.
04:50Here's one that's meant to be useful for designers with the Timeline at the top
04:54and the color and drawing tools very visible.
04:56Here's another one that's meant to be useful for developers and so on.
05:00Finally, let's say you've created a panel layout you really love.
05:03Let's pretend and just have the toolbar float above all the other panels and expand it.
05:08You can now choose New Workspace, type in a name for your layout, and save it.
05:13Your new workspace now appears in the list of possible layouts you can choose.
05:17For now, I am just going to be boring and reset my workspace to the Essentials layout.
05:22The final thing to know about panels is that you don't automatically see all of
05:25them that exist when you open up Flash.
05:27If you go to the Window menu and hover over Other Panels, you'll see some others that exist.
05:32One useful panel is the History panel.
05:35If you slide the little slider bar up the left-hand side, Flash will step
05:38backward through all of the steps that you just did.
05:41This can be a nice way to undo steps if you want to change your Flash file back
05:44to the way it was five minutes ago and you don't know how many times you'd have
05:48to push Ctrl+Z to get there.
05:50And with the History panel, you can also step back forward through the steps.
05:54We've now heard the most important terminology and seen how you can change the
05:58layout of the workspace and different panels available in Flash.
06:01So let's start creating some exciting content.
Collapse this transcript
Understanding and importing bitmaps and vector files
00:00While Flash provides you a number of drawing tools, using imagery that's
00:04been created outside of Flash is likely going to be something you'll want to do often.
00:08You can import both bitmap and vector graphics into Flash.
00:11So let's talk about the differences between vector and bitmap and take a look
00:15at the import process.
00:16Here we'll perform the first steps to create the finished project you previewed
00:19earlier at the start of the course with the lady driving the car.
00:23As a refresher of what this looks like, double-click on fastCar.swf in the
00:27Exercise Files for this chapter.
00:29Right now we'll be working with the background image and the image of the lady in the car.
00:33(video playing)
00:38I am going to start by creating a new blank ActionScript 3.0 file and save it as fastCar.fla.
00:46In the Property Inspector, notice the default document settings that have the
00:49stage dimensions as 550x400, the frames per second at 24, and a white background color.
00:56Let's import a background graphic which is a bitmap.
00:59Go to the File menu and choose Import, then Import to Stage.
01:03In the Exercise Files for this movie, find the file called background.jpg and
01:08click Open to import.
01:09Flash thinks about it for just a moment and the import process is done.
01:13Because the image is on the stage, it also appears in the library.
01:17Click on the Library tab to see it, and there it is.
01:20Click on the image on the stage to make sure it's selected and then open
01:23your Property Inspector and notice that it shows the width of our image is
01:27550 and the height is 400.
01:29It's great that this image is already the same size as our stage because it's a bitmap.
01:34Bitmap images don't scale up and down easily.
01:37You can think of image information for bitmaps kind of like a grid.
01:40For instance, one pixel is green, then the pixel next to it is red, then the
01:44pixel next to it is blue, and so on.
01:46If you need to scale a bitmap image so it's bigger, your image program has to
01:51guess what color to use to fill in the extra space you've added to the grid.
01:55Likewise, scaling a bitmap image down also requires some guesswork as to
01:59what color to make each pixel since you're essentially making the area of the grid smaller.
02:03You can see this behavior by clicking on the image to make sure it's still
02:07selected and then over in the toolbar selecting the Free Transform Tool.
02:11Transformation handles appear on your image and you can then resize it.
02:14I am going to approach the upper right-hand corner of the image and you'll see a
02:18double-headed arrow appear.
02:19This allows me to change the width and the height of the image at the same time.
02:23If you hold down the Shift key while clicking and dragging with the
02:26double-headed arrow, the width and height stay in proportion to each other as
02:29the image is made bigger or smaller.
02:32Go ahead and make your image really big.
02:34See how the image quality kind of degrades as the image gets bigger?
02:38The trees, leaves, and other items in the image start looking blocky or pixelated.
02:43This is because as the bitmap scales, there's not defined information to fill in
02:46the extra pixels you're asking the image to include.
02:49Pictures you take with a camera are a great example of imagery captured as a
02:53bitmap, and you'd use a program like Adobe Photoshop to be able to resize
02:57bitmaps without getting that pixelation.
02:59So the conclusion to take away about bitmap images is that it's best to have
03:03them sized at the correct dimension you need before importing them into Flash.
03:07So now that we've sufficiently messed up our image, let's change back to our
03:11Arrow Selection Tool and click on the image to make sure it's still selected.
03:15In the Property Inspector, I am going to restore it to its correct dimensions by
03:19typing 550 for the width and 400 for the height.
03:22I actually didn't have to type in the 400 because the little chain for linkage is here.
03:28It's locking the width and height values together.
03:30To place it so it sits squarely in the middle of the screen, I am going to type
03:330 for the X position and 0 for the Y. So we're back to where we started and the
03:38pixelation we saw, when we stretched the image out, has gone away.
03:41Let's move on and import a vector file.
03:44I am going to go to the File menu again, scroll down to Import, and this time
03:48select Import to Library.
03:50Navigate to the start folder for this movie's Exercise Files and choose the file
03:54called CarWithDriver.ai.
03:57This is an Adobe Illustrator file.
03:59We're presented with some options before we import our file.
04:02Down in the left-hand side, you can select or deselect which layers from the
04:06Illustrator file you want to include in the import.
04:09We want them all, so I am just going to leave them all checked.
04:11In the Convert to layers dropdown, you can choose to have Flash preserve the
04:15layers by choosing Flash Layers.
04:17You can also have Flash squish all the layers into one by choosing Single Flash
04:21Layer or you could have it convert all layers to keyframes.
04:24We haven't discussed keyframes yet, but that's okay because we want to go
04:28ahead and preserve the layer set up in Illustrator, so let's just leave this at Flash Layers.
04:32Leaving these other checkboxes at their defaults is fine as well, so let's click OK.
04:37It doesn't look like much has happened because we imported the stage into the
04:40library, not to the stage.
04:42Click to open your library and indeed the car image is there as a graphic symbol.
04:46We'll cover symbols in detail later, but for now, think of symbols as a
04:50reusable blueprint.
04:52Having the items in our library named something that describes what the item
04:55actually is, is a good practice.
04:58CarWithDriver.ai is pretty intuitive, but let's double-click on the current name
05:03and change it to just plain CarWithDriver.
05:04So you've probably noticed that importing something to the library does not
05:09automatically place it on the stage.
05:11If it's in the library but not on the stage, it's not included in the final SWF.
05:15Well, we need our car image on the stage, so I am going to scroll down a little
05:19bit and drag it out from the library onto the stage.
05:22It's a little too big, so I am going to head over to the toolbar and grab my
05:26Free Transform tool or you could just hit Q on your keyboard.
05:30Notice that you can change the dimensions as much as you want and the image
05:34always stays looking sharp and non-pixelated.
05:36That's because this is a vector graphic.
05:38Instead of storing information about the image like a grid, like bitmaps do,
05:43vectors instead use mathematical equations to describe the shapes and curves.
05:47As you change the image, the shapes of the image are simply recalculated, so it
05:52always appears crisp.
05:53While it's a good idea to have that vector imagery already sized correctly
05:57before you import it into Flash, you can see that adjusting the size after the
06:01fact works just fine.
06:02So I am going to change my car and driver by opening the Property Inspector and
06:07making sure that the icon of the chain here still looks like a linked chain.
06:11This way we're locking the width and height values together.
06:13I am going to type in 345 for the width and the height should
06:16automatically update to 140.
06:17I am also going to reposition the driver by giving here an X position of 114 and a Y of 216.
06:24Now using my Arrow tool, I am going to double click on the image of the car.
06:29You'll notice that the screen has changed.
06:31The top left of the screen says Scene 1 and then CarWithDriver and the
06:36background image is grayed out.
06:37What we've done is stepped into the car image itself.
06:40Notice how you can click on each one of the wheels individually as well as
06:43the body of the car.
06:44Now double-click on the body of the car and see now how the wheels are grayed
06:48out since we've stepped into the group of shapes that make up the body.
06:53Notice also how the upper left of the screen now says Scene 1,
06:55CarWithDriver, and then Group.
06:58You can drill down even further by double- clicking on part of the car such as the door.
07:02What we're seeing here is all the individual layers from the original
07:06Illustrator file that have been preserved.
07:08This is going to prove useful down the line since we're going to animate the wheels.
07:12But for now, I am going to click on Scene 1 on the upper left to return to the
07:15main timeline and save my file.
07:18There's one last vector image that we'll use later on in our fast car movie, so
07:22one last time, I am going to go to the File menu, Import to Library, and from
07:26the start folder for this movie choose face.ai.
07:30In the Import dialog box, I am just going to leave all the defaults as they are and click OK.
07:35In the Library, you can now click face.ai to see a preview.
07:39It's the face for the sun that we'll draw later on, so for now we'll just leave it here.
07:43Let's change the name of it however from face.ai to just plain face.
07:47So you can see that importing imagery into Flash whether it's vector or bitmap
07:52requires only the simple steps of going to File and then Import and then
07:56choosing if you want to import to the library or the stage.
07:59Both types of images are okay to use, but remember as a best practice to
08:03have your imagery, especially bitmaps, sized correctly before bringing them
08:07into Flash.
Collapse this transcript
Organizing layers
00:00One really good way to organize all your visual assets on the stage is by using layers.
00:05If you've used layers before in programs like Adobe Photoshop or Illustrator,
00:09the concept will transfer easily for you.
00:11To explore this, I am back in that fastCar project we started earlier.
00:15In Flash, the layers are controlled from the Timeline.
00:18Look at the bottom left of your screen next to the Timeline and you'll see that
00:21we currently have one layer in the Flash movie.
00:23Our background image and the car are both on this layer.
00:26A best practice while working in Flash is to have each visual item on the
00:30stage have its own layer.
00:31That way you can work with one individual asset at a time and not
00:35accidentally affect other items.
00:36As we progress further into Flash and start working with animation, you have to
00:40have individual assets on their own layers to create the animation.
00:44So organizing your movie layers is a good habit to get into early.
00:47A handy technique to know when you have multiple items on one layer like we do
00:51is to have Flash separate them out for you.
00:53To try this, hit Command+ or Ctrl+A on your keyboard to select all the items on our layer.
00:59You can see that both the car and the background image have a thin blue line
01:03around them to show they're selected.
01:05Now right-click somewhere on your selected objects and choose Distribute to
01:08Layers from the context menu that appears.
01:11You can alternatively go to the Modify menu, go to Timeline, and then select
01:15Distribute to Layers.
01:17Notice that we now have three layers.
01:19You can turn the visibility of layers on and off as an easy way to see what's on each layer.
01:24So on the layer where it says CarWithD, click on the little Dot (.)
01:28in the column under the icon of the eye.
01:30The car disappears, so this is the cars layer.
01:33Now I am going to click on the Dot (.)
01:34next to the background layer and we'll see the background image appear and disappear.
01:38You can click on the eye icon itself to affect the visibility of all the layers at once.
01:43The original layer that that background and the car were on is now empty.
01:48Besides the fact that we just saw what layers the car and background are on, you
01:52can tell the layer is empty in two other ways.
01:55First, turn the visibility of the layer on and off and nothing happens since
01:59there's nothing on the layer.
02:00Also, notice how the car and background layers have the first frame in the
02:04timeline filled in with a gray background and a filled-in black Dot (.).
02:08Having that color indicates there's something on the layer.
02:11The Layer 1 layer doesn't have the shading or a filled-in Dot (.)
02:15and that indicates the layer is empty.
02:17Since we're not using that layer anymore, we can delete it.
02:20Just click once on it and then click the little trashcan at the bottom of the Timeline.
02:24Another best practice is to name your layer something intuitive.
02:28With only two items on the stage, this may not seem that important, but when you
02:32have Flash projects with tens or hundreds of layers, you'll appreciate layer
02:35names that make sense as opposed to Layer 1, Layer 2, Layer 3.
02:40To change a layer name, simply double- click on the name and type in a new one.
02:43Let's name the top layer "stationaryCar" and the bottom layer "bgImage."
02:48To avoid moving things around on the stage by accident when you've got them
02:51positioned just right, you can lock your layers.
02:54Just like the eye, you can click on the Lock to toggle all layers between
02:58locked and unlocked.
03:00With them locked, try selecting anything on the stage and, indeed, you can see we
03:04can't move anything.
03:05Since the background layer isn't going to change, let's leave that locked but
03:09we'll soon be doing things to the car, so let's unlock just that layer by
03:12clicking on the little lock in the Lock column.
03:15The column underneath the little rectangle to the right of Lock allows you to
03:19view some or all of the layers as outlines.
03:22This can come in handy at times, for instance, if you're trying to line up one
03:25item precisely behind another.
03:28You can easily change the stacking order of your layers by dragging and
03:31dropping a layer up or down.
03:34As I drag the background layer above the car, you'll notice a dark black
03:37line appears to indicate where the layer is going to be placed when I release the mouse.
03:42You can see that the car disappears on the stage now because it's behind
03:45the background image.
03:46Since we want to see our car, I am just going to move the background layer back down.
03:50If you need more layers, simply click on the icon that looks like a little piece of paper.
03:55New layers are added above whatever layer you have selected.
03:58So let's select our stationaryCar layer and add two new layers that we'll use
04:02later on in the course.
04:04Rename the bottommost one "audio" and the topmost one "actionscript."
04:09You can further organize your layers by creating and using folders.
04:12Click on the Folder icon at the bottom of your layers to create a new folder.
04:17You can drag and drop folders just like you can layers, so let's drag the folder
04:21just above the stationaryCar layer.
04:22I am going to put the stationaryCar layer into the folder by clicking and
04:27dragging the layer up and slightly to the right.
04:29You can see it's now indented under the folder to indicate it's inside.
04:33Let's move the background layer into the folder too.
04:36You can also rename folders, I'll call this one "visualContent."
04:41Clicking on the little arrow to the left of the folder name allows you to expand
04:45and contract the contents in the folder.
04:47There's a special type of layer called a Guide layer that may prove useful to you.
04:51On the bgImage layer, double-click on the icon that looks like a piece of paper
04:55to open the Layer Properties box.
04:58Using the radio buttons, change this layer from a Normal layer to a Guide
05:01layer and click OK.
05:03Notice how the icon on the Timeline has changed from a piece of paper to what
05:06looks like a T-square to indicate this is a Guide layer.
05:09Guide layers are visible while working in your FLA and let's test our movie.
05:14You'll see that the background image no longer appears.
05:17That's what Guide layers are for.
05:18Maybe you want to put a comp in this layer to help you arrange things on the
05:22stage or maybe you want to type instructions to another developer who will also
05:26be working on your Flash file.
05:28Whatever the reason for using the guide layer, another advantage is that
05:31this file size associated with the content in the layer is not included in the resulting SWF.
05:37Click on your stage and then open up the Properties panel.
05:40Here in the SWF History, you can see that the size of the SWF we just created is 3.8K.
05:45Double-click on the icon next to the Guide layer name again and change it
05:49back to a Normal layer.
05:50Test the movie again, close the SWF, and then open up the Properties Inspector again.
05:55My file size has jumped up to 95.3k because the size of the background image is
06:00now included in the SWF.
06:02The little yellow exclamation point (!)
06:03next to the file size is just an indicator that the SWF size has increased over
06:0750% which in our case is okay.
06:10Use Guide layers to your advantage, but I would recommend that once you're done
06:13with them, delete them even though they're not included in the final SWF.
06:16That way your FLA files include only layers with content that's actually used
06:20on the stage.
Collapse this transcript
Introducing the Timeline and frames and keyframes
00:00Controlling animation and the appearance and disappearance of objects on the
00:04screen over time is a big part of the appeal of Flash.
00:07Understanding how to use the Timeline, Frames, and Keyframes is integral to
00:11this type of control.
00:13To practice this I've created a test file called travelPhotos.fla.
00:17It's a pretty simple file with only five layers and four images in the library.
00:23Before we start working, in your Exercise Files, pop open the
00:26travelPhotosPreview.swf to see what we're building toward.
00:32This is a short movie, only 5 seconds long.
00:35Four images appear in succession with a short piece of text appearing at the
00:38same time as the last image, then the movie starts over.
00:42So close this preview file and return to your travelPhotos.fla file in Flash.
00:48Before starting, I'm going to use the View dropdown on the upper right of the
00:51stage and choose Fit in Window so we can see the entire stage.
00:56The Flash Timeline, which appears across the bottom of the screen, is
01:00measured in frames.
01:01You can see the frame numbering across the top of the Timeline.
01:05How fast those frames are played is determined by the frames per second.
01:08To remind ourselves what our FPS is, click on your Property Inspector.
01:12We're at 24 frames per second.
01:14Our movie currently only has one frame.
01:17So to have a movie that's 5 seconds long, we need to extend our Timeline out to
01:22120 Frames, since 5 seconds multiplied by 24 frames per second equals 120.
01:29Click on Frame 1 on the image1 layer.
01:32You can add frames one at a time by pressing F5 or right clicking and
01:38choosing Insert Frame.
01:40Of course, adding frames one at a time is pretty tedious, so grab the slider bar
01:45that appears under the Timeline and slide over so you can see Frame 120.
01:50Click on Frame 120, making sure that you're selecting 120 on the image1 layer,
01:56and now right-click on the frame and choose Insert Frame.
02:00Alternatively, you could select Frame 120 and press the hot key of F5.
02:05You can see that image1 now has 120 frames.
02:09Now, open up your Library and drag-and- drop vacation_1.jpg to the stage, kind
02:14of over on the left.
02:17You can see that if you try to drag it to the Timeline, Flash doesn't let you.
02:21You can only drag things onto the stage.
02:23Notice, our frames now all turn gray to indicate there's something on the stage.
02:28Notice also the vertical red line that now appears over the Timeline.
02:33This is called the playhead and you can drag it across the Timeline to preview
02:37what your Flash movie looks like so far.
02:39Dragging the playhead is better known as scrubbing the Timeline.
02:42I'm going to scrub my Timeline all the way back to Frame 1.
02:45Of course the stage looks the same no matter what frame we're on so far since
02:49the image just stays in the same place for all the frames.
02:52Now, if you'd like to see more or less of the Timeline at once, click on this
02:56little dropdown at the upper right of the Timeline window;
02:59choosing Tiny, shrinks the view of the frames so you can see more at once.
03:04Conversely, choosing Medium makes it so you can only see maybe 45 frames.
03:08You can experiment with what works best for you, but I'm going to stick with
03:12the default of Normal.
03:14Now, let's extend our other layers out to Frame 120.
03:17Use the scroller so you can see that frame and then click on Frame 120 on the image2 layer.
03:24Instead of extending each layer out individually, you can multiple-select by
03:28holding down the Shift key on your keyboard and selecting Frame 120 for the
03:32image3 and image4 layers as well.
03:35Add your frames by pressing F5 or right clicking and choosing Insert Frame.
03:39We now have 120 frames on these layers as well, but you'll notice that they all
03:44have a white background instead of gray, because there's nothing on the stage
03:47for these layers yet.
03:48So move your playhead over to Frame 1 and press Enter on your keyboard.
03:52You'll see the playhead move and also two counters on the bottom that show what
03:57frame the playhead is on and how many seconds that corresponds to.
04:01The playhead stops when it gets to the end.
04:03Now in the text layer select Frame 125 and Insert Frames.
04:08Scrub your Timeline near the end of the frames and you'll see the stage update
04:12appropriately depending on what frame your playhead is on.
04:15The stage is of course empty from Frames 121 to 125 since there's only
04:21blank frames there.
04:22And let's test our movie.
04:24And as expected, the SWF behaves pretty much the same way, but you'll see the
04:29little blip at the end.
04:32In the SWF the playhead returns to Frame 1 as soon as it's reached the end of the frames.
04:37So we see 5 seconds worth of seabird and then five frames worth of blank frame,
04:42and then back to Frame 1 where the bird image appears again.
04:47So now we've seen how the playhead runs over the Timeline and shows you what's
04:51on stage, but we don't need those blank frames anymore.
04:54So to get rid of them, click on Frame 121 in the text layer, then hold down the
04:58Shift key on your keyboard and select Frame 125, so you have all the blank
05:03frames selected, then right- click and choose Remove Frames.
05:07Let's move on to the idea of keyframes.
05:10One way that may be helpful to think of keyframes is to think about stop frame
05:14animation as used in Claymation.
05:16If you've watched shows like the California Raisins or Shaun the Sheep or
05:20Wallace & Gromit, you can imagine how the clay characters are put into position,
05:24an image is snapped, and then the character is repositioned and another image
05:28taken, and so on and so on in succession.
05:31Keyframes are the equivalent of this.
05:33Each keyframe shows the specific starting position, size, and other attributes
05:38of items on the screen.
05:40When you need new positioning, you need a new keyframe.
05:43Keyframes in Flash are indicated by a circle.
05:45Move your playhead to Frame 1 of your Timeline and you'll notice that all our
05:50layers have a keyframe on Frame 1.
05:52However, image1 is the only layer that actually has anything on the keyframe and
05:57you can tell because this circle is filled in and the background's gray.
06:01A non-filled in circle and white background indicates a blank keyframe.
06:06Frames 2 through 120 on the image1 layer all look the same as the keyframe on
06:12Frame 1, because they're just frames, not keyframes.
06:16They simply extend over time whatever the keyframe defines.
06:20If you wanted the seabird image to be in a different position on say Frame 20,
06:25you need to add a new keyframe by right clicking on Frame 20 and choosing Insert Keyframe.
06:31What Flash does is copy the information from the most previous keyframe, in this
06:36case Frame 1, and stick it in the new keyframe.
06:39You can then move the bird image on Frame 20 to a different position and you can
06:43see the effect of this change when you scrub the playhead.
06:47Since this new keyframe was just for demonstration, let's get rid of it by right
06:51clicking on Frame 20 and choosing Clear Keyframe.
06:54Now all of our frames are restored back to the positioning defined in keyframe one.
06:59Let's rotate our image slightly to give it a little more visual interest.
07:03Click on the image to select it and you'll notice that all the frames in the
07:06Timeline are now highlighted.
07:08We only have one keyframe that all the other frames look exactly alike.
07:13So what we're about to do will affect the image all the way across the Timeline.
07:16Now, choose the Free Transform tool or press the hot key of Q. Rotate your image
07:22to the left a bit, as much as you think looks good.
07:26So our little project here is meant to have a succession of images appear on top of each other.
07:30Let's go ahead and lock our image1 layer because we're done with that, and have
07:34the second image appear in the image2 layer at one second into the movie.
07:38At a Frame Rate of 24 frames per second that would be, of course, Frame 24.
07:43So find Frame 24 in the image2 layer, and it may help to look at the little
07:47number underneath the Timeline to see exactly which frame you've selected.
07:51Right-click and choose Insert Blank Keyframe.
07:54You can also go to the Insert Menu, then Timeline, and then Insert Blank Keyframe.
08:00You may be wondering if you could have chosen Insert Keyframe instead.
08:04Remember that inserting a keyframe creates a new keyframe with the information
08:09from the previous keyframe copied over into it.
08:12Since our previous keyframe is a blank keyframe, it doesn't really matter if you
08:16choose to insert a keyframe or a blank keyframe, you end up with the same thing.
08:21From your Library, drag-and-drop image2 onto the stage offsetting it from the
08:26other image a little bit.
08:27We should rotate this a little bit too.
08:29So move your playhead to a point where you can see both images.
08:33Select the image of the tree, press Q on the keyboard to bring up the Free
08:36Transform tool, and rotate and reposition it as much as you think looks good.
08:42This looks good so far, so I'm going to lock our image2 layer and add a third
08:46image in at 2 seconds into the movie, which is Frame 48.
08:49So I'm going to right-click and choose Insert Keyframe and now
08:53drag-and-drop vacation_3.jpg onto the stage and position it so it's offset
08:58from the other images.
09:00That's all we have to do for this layer.
09:02So I'm going to lock the image3 layer and repeat one more time for the fourth
09:06image, but this time we'll make a mistake on purpose so we can see how to easily
09:10move keyframes around.
09:12Select Frame 1 of the image4 layer and drag-and-drop vacation_4.jpg from the
09:17Library onto Frame 1.
09:20This is obviously not the right place to put this image if we want it to be our
09:24fourth image to appear in the succession.
09:26It should appear at 4 seconds into the movie, which is Frame 72.
09:30This is easy enough to fix.
09:32Simply select the keyframe on Frame 1 and then drag-and-drop to Frame 72.
09:37This looks more correct.
09:39So let's reposition the image so it looks good and lock the layer since
09:42we're done with it.
09:43Scrubbing your playhead, we can see that this image will appear for 48 frames or
09:472 seconds, allowing the user a little more time to see it than the others.
09:51The extra layer is there because the last item is to type the greeting that
09:55appears at the same moment as the last image, and 2 seconds is better than 1 if
09:59you expect people to actually be able to read what the greeting says.
10:02So on the text layer I'm going to select Frame 72 and insert a blank keyframe.
10:08Now, I'm going to use my Text tool and in the Property Inspector make sure that
10:12under the very first dropdown Classic Text is selected.
10:15Under the second dropdown choose Static Text.
10:19We'll talk about all the options in these dropdowns later on.
10:22In the Character option for my Font I'm going to choose Arial Bold Italic at 16
10:27point, and have the Color of the text be white.
10:30You can choose something else if you wish.
10:37Under the Paragraph section I'm going to have my text be entered.
10:41Now, I'm going to click on the stage once and type the greeting.
10:44I'm going to put, "Having a great time!
10:46Wish you were here! Love, Uncle Chris."
10:53Reposition the textbox with your Arrow tool if you need, and when you're happy
10:57with your layout, lock the layer and let's test our movie.
11:00It takes a total of 5 seconds and the images and text appear in succession.
11:04Now, that's a job well done.
11:06Close your SWF file and let's take a moment to play with the Frame Rate.
11:10Open your Property Inspector and click on the stage somewhere if need be, so you
11:14can see the Document Properties.
11:16We laid out our Flash movie with the understanding that we were at 24 frames per second.
11:21Try changing the Frame Rate to 12 and publish again.
11:24As you'd expect, the playhead is moving half as fast as it did before and the
11:29movie now takes 10 seconds to run.
11:32Let's close our SWF and change our Frame Rate back to 24.
11:36Frame rates between usually 12 and 30 are commonly accepted, so it's fine to
11:40choose the frame rate that works for you.
11:42If you're working on a piece that might interact with or be loaded in by another
11:46Flash movie, or one that needs to sync up with a video, be sure to agree with
11:51your colleagues ahead of time what the frame rate is so all the pieces match.
11:55The best practice is to choose your frame rate ahead of time and position items
11:59on the Timeline accordingly.
12:01Positioning on the Timeline first and changing the frame rate later can
12:04sometimes be a disaster.
12:06Changing the frame rate to adjust one part of the movie may adversely affect
12:10other parts you designed at a different rate.
12:13One last thing, when testing our movie you may have noticed that the first two
12:16images, the bird and the tree, look a little bit jagged, because they're bitmaps
12:20that have been rotated.
12:22There's an easy way to fix this.
12:24Close the SWF file and open up your Library.
12:27Next to vacation_1.jpg, double-click on the little icon of the tree, which
12:32indicates it's a bitmap.
12:34In the resulting Bitmap Properties box, find and check the box next to Allow
12:39smoothing and click OK.
12:41Let's do the same one for vacation_2.jpg. Double-click on the icon to open,
12:46check the box, and click OK.
12:47Publish your SWF one last time and you'll see that the images now appear
12:52crisp and sharp.
Collapse this transcript
Using frames and keyframes in a project
00:00In our fastCar.fla project, let's apply some frames and keyframes to the movie
00:06to control the Timeline and get the car moving.
00:09This piece is going to be a total of eight seconds long.
00:12The first four seconds will have some intro text that says "The really fast new
00:16sports car" with a lady in car sitting in the middle of the screen.
00:19The last four seconds will have the car driving by, and some lyrics to a pretend
00:23song displayed at the same time.
00:25Let's see what our frame rate is.
00:27If you can't see it, click on the Property Inspector and then click somewhere on the stage.
00:31It's currently set to 24, but let's change it to 12, for no other reason than to
00:36practice with a different frame rate.
00:37Eight seconds multiplied by the frame rate of 12 equals 96 frames.
00:43So let's extend all the layers at once by selecting frame 96 on the top layer,
00:47holding down the Shift key and then selecting frame 96 on the bottom layer.
00:51Right-click and choose Insert Frame or just hit F5.
00:56Let's add our intro text for the first four seconds.
00:59We need a new layer for this.
01:01So select the stationary car layer, add a new layer and rename it to introText.
01:06Now select frame 1 of the introText layer and choose the Text tool from your Toolbar.
01:12In the Property Inspector, choose Arial font, Bold Italic and a font size of
01:1724 and center-aligned.
01:18Let's also change the Color to red of CC0000. Click on the stage and type the word "The."
01:28Now for the rest of the phrase, click on the stage once to deselect the textbox
01:32and then a second time to create a new textbox.
01:35Let's adjust our text settings to be 36 point font and yellow.
01:39Then type "Really Fast New" and then "Sports Car" on a second layer.
01:46Use your Arrow tool to adjust the text as needed.
01:50You can see that our introText spans across all 96 frames.
01:54Since this text should only appear for the first four-second intro, we need to
01:58insert a blank keyframe halfway through.
02:00Frame 48 would be a full four seconds so let's right-click on Frame 49 and
02:05choose Insert Blank Keyframe.
02:07Scrub your Playhead across the Timeline. So far so good, so I'm going to lock this layer.
02:12Now we should modify the movie so that the car that appears on Frame 1 also
02:16lasts for only four seconds.
02:18In the second half of the movie, the car will drive across the stage from right to left.
02:23So I will move it to its starting position now and set up the animation later.
02:27Let's start by splitting the Stationary Car layer into two parts.
02:31Select Frame 49 for this layer and insert a keyframe not a blank keyframe, a keyframe.
02:36The car is in the right position for Frames 1 through 48 already.
02:40Move the Playhead to Frame 49 or later, if it's not already and then move the
02:44car off the screen to the right.
02:46If you hold down the Shift key while moving the car, it won't float up or down
02:49as you move it off screen.
02:51Make sure it's totally off-stage. This will be the starting position for the
02:54animation from right to left.
02:56Keeping with our best practice of having individual things on individual layers,
03:00let's split up our stationary car and are not quite yet moving car onto their
03:04own layers, so it's easy to differentiate.
03:07Select the introText layer in the Timeline, add a new layer above it and
03:11rename it "movingCar."
03:13On the new movingCar layer, create a new blank keyframe on Frame 49.
03:18We can cut and paste the soon-to- be moving car onto this keyframe.
03:23So click on the car, go to the Edit menu and then choose Cut or you can press
03:28Ctrl+ or Command+X on your keyboard to cut.
03:31Now select Frame 49 on the movingCar layer and go to the Edit menu and
03:35then Paste in Place.
03:37You could also use the hotkeys of Command or Ctrl+Plus+Shift+V. Go ahead and
03:44lock your movingCar layer and save your work.
03:48Scribe your Playhead to see the clear differentiation we set up between the
03:51introductory four seconds with the introText in the stationary car, and the last
03:56four seconds where the car will eventually move across the stage.
03:59Notice also how the background layer remains constant regardless of where in
04:03the Timeline you are.
04:04So now we've seen how to use a combination of frames, keyframes and blank
04:09keyframes, to give us complete control over what appears when, and for how
04:12long on the Timeline.
04:14The interaction between the number of frames and the frame rate also determines
04:18how fast or slow the movie will play.
Collapse this transcript
3. Creating Graphics
Creating shapes in Merge Drawing mode
00:00There are two drawing modes available to you when using the drawing tools in Flash.
00:04Merge Drawing mode and Object Drawing mode.
00:07To explore Merge Drawing mode, let's create a blank FLA document in Flash and
00:11select one of the drawing tools.
00:12I am going to choose the Rectangle.
00:15When you do, the Property Inspector should open.
00:18Like other drawing programs, Flash lets you choose what color the outline or
00:21stroke is going to be as well as the fill.
00:24Click once on the color chip next to the icon of the pencil to expand the
00:27color palette for stroke.
00:29And let's make our stroke be black.
00:31Clicking once on the color chip next to the paint bucket, let's make our fill be red of CC0000.
00:39Before drawing our rectangle, let's make sure that we're using Merge Drawing mode.
00:43When you select a tool, the properties area underneath the toolbar also changes
00:47to show you more options available for that tool.
00:49For our rectangle, we see a little icon that looks like a circle within a square.
00:55This icon is how to toggle between Merge and Object drawing modes.
00:58Merge Drawing mode is the default when you start a new FLA and you can see that
01:03the icon is kind of a light gray color.
01:05If you click on the icon, it turns to a darker gray and puts you into
01:08Object Drawing mode.
01:11The difference between the light gray and the dark gray can be kind of subtle.
01:14It's not the strongest mnemonic device but to try and help remember which is
01:19which, I say that the medium gray is for Merge Drawing and the dark or more
01:23opaque gray is for Object Drawing, so medium for merge opaque for object.
01:29We want Merge Drawing mode so make sure the icon is the lighter gray color.
01:33If you're still not sure which one you have got, just draw a rectangle on the
01:36screen by clicking and dragging.
01:38Then use your Arrow tool and select the rectangle.
01:43If your Property Inspector shows that the selected object is the shape, then you
01:47know you're in Merge Drawing mode.
01:49If your Property Inspector says drawing object, you are in Object Drawing mode.
01:53So if you have got a drawing object, please delete it and redraw the rectangle
01:57in Merge Drawing mode.
01:58And shapes are basically what Merge Drawing mode is.
02:01It just creates blobs of color on the stage in different shapes depending on
02:05which tool you've chosen.
02:06Now one thing about drawing in Flash is that the stroke or outline of a shape is
02:10treated separately than the fill.
02:12Click once somewhere outside of your rectangle to make sure nothing is selected
02:16and now click just once in the middle of your rectangle and notice that only
02:20the fill is selected.
02:22You can tell because it has that kind of stippled pattern of white dots.
02:25If you drag and drop the rectangle somewhere else on the stage, only the fill goes.
02:29I am going to hit Ctrl+Z to undo this move.
02:33Now, double-click on the rectangle and you will see that both the fill and the
02:36stroke are selected allowing you to move both together.
02:40It's a common mistake to click only once on a shape and take just the fill
02:44so try to remember that you have to click twice to get both the stroke and the fill.
02:48Affecting the stroke by itself is, of course, just as easy.
02:51Click on the stage somewhere away from the rectangle, again to deselect
02:54everything or you could also hit Command+ or Ctrl+Shift+A to deselect.
03:00Now try clicking once on the top line of the stroke.
03:04Notice that just the top line is selected and you can move that section away.
03:07I am going to hit Ctrl+Z to undo that.
03:10If you want to select all of the stroke you have to double-click somewhere on
03:14the stroke and then move it wherever you'd like to.
03:16But I am not going to move it right now.
03:19I want to show you a nifty technique.
03:21Click on the stage somewhere away from the rectangle again to deselect and now
03:25approach one of the edges of the rectangle with your mouse.
03:28You will notice how a small icon of a curved line appears.
03:32While that's visible, you can change your rectangle shape by clicking and
03:35dragging out the edge.
03:37Similarly, if you approach a corner of your shape with a mouse, you will see
03:41a little angle icon appear which allows you to click and drag the angles to modify.
03:46If you select and move your fill away from your stroke, like this, you will see
03:52that this technique still works on both the fill and the stroke separately.
03:56Let's try a different shape.
03:58In the toolbar, click and hold down on the Rectangle tool and some additional
04:02tools open in a little dropdown.
04:05Select the Oval tool and then in the Property Inspector, let's choose yellow for the fill.
04:09This time let's not have any stroke.
04:12When you expand the color palette for stroke, choose the icon of the white
04:15rectangle with a red diagonal line across it to indicate no stroke, and now draw
04:20an oval on the stage.
04:26It's time now to see a few behaviors that are perhaps where Merge Drawing mode got its name.
04:31Drag your circle so it's positioned partially over your red rectangle fill.
04:35You will notice that if you leave the yellow fill selected, you can just
04:41continue moving it around.
04:43However, try placing it over the red and then deselect the yellow either by
04:47clicking on the stage or pressing Command+ or Ctrl+Shift+A. Now click on the
04:53yellow fill again and move it elsewhere and you can see that the yellow has kind
04:57of cut it shape out of the red.
04:59This behavior can be useful or annoying depending on what you are trying to do.
05:03So try to remember that this is how shapes drawn in Merge Drawing mode behave.
05:07You can also kind of work in the opposite direction.
05:10Select your circle and in the Property Inspector, change the fill color from
05:13yellow to the same red as the rectangle which should be CC0000.
05:19Move your red circle over the red rectangle, the positioning doesn't have to be
05:23precise and deselect everything by clicking on the stage.
05:26Now select the red fill again and you'll see that the two shapes have been
05:30fused or merged together.
05:33So what if you want to be able to move all of your shapes on the screen as a unit.
05:38This is easily achieved by selecting all which is Command+A or Ctrl+A on your
05:42keyboard and then going to the Modify menu and choosing Group.
05:47You can also hit Command+G or Ctrl+G on your keyboard to Group.
05:53Now when you select any of your shapes, you select the whole group.
05:57And indeed the Property Inspector no longer shows you've clicked on a shape,
06:00instead you've clicked on a group.
06:02You can move the group around as you wish and you can even double-click on the
06:06group to step inside of it to edit the individual shapes.
06:10Notice how above the Timeline it now says Scene 1 and then Group.
06:14Your shapes behave just as they did before they were grouped.
06:17You can move them around individually, you can change their shape, and so on.
06:21Just be sure to click Scene 1 to step back out of the group when you're done modifying.
06:27Ungrouping is just as easy.
06:29You just select your group and go to the Modify menu and then choose Ungroup.
06:35Now that we've seen Merge Drawing mode, you might be wondering how to keep
06:39your individual shapes and strokes from cutting each other out or merging
06:42unintentionally while drawing, as we saw the rectangle and the circle do earlier.
06:47The solution to this is our best practice of keeping individual visual items on
06:51the screen on their own separate layers.
06:54So that's the basics of working with Merge Drawing mode.
06:57Let's go ahead and now practice with this in our fastCar project.
07:00So you can go ahead and close this FLA since it just has practice shapes in it.
Collapse this transcript
Working with shapes in Merge Drawing mode
00:00Let's practice adding some Merge Drawing mode shapes to our fastCar project.
00:05So go ahead and open that file if you don't have it already, from your Exercise files.
00:10We're going to draw the sun and our sun is going to have four elements;
00:13yellow points to look like sun's rays, orange points to look like more sunrays,
00:18a yellow circle for the face and finally, the face itself, made up of
00:22sunglasses and a smile.
00:24Each item will have its own layer.
00:25So we need four new layers.
00:28The sun should appear throughout our entire 96-frame movie.
00:31So let's select the background layer and insert four new layers above it.
00:35I'm going to expand my timeline, so we can see them all at once.
00:40Let's rename our new layers bottom to top as "yellowSun," "orangeSun," "sunCircle" and "sunFace."
00:46So with our layers like this, all five of them that are going to exist for all
00:5196 frames are kind of visually grouped together on the timeline.
00:55Now let's select Frame 1 of the yellowSun layer and in the toolbar, click and
00:59hold down the Oval or the Rectangular, whichever one you got showing there, and
01:03choose the PolyStar tool.
01:05This tool allows us to choose between drawing polygons and stars.
01:09So in the Property Inspector under Tool Settings, click on the Options button.
01:14Under the Style dropdown, choose Star;
01:17for Number of Sides, choose 7.
01:19So we get seven points.
01:21For Star point size, type in 0.5 if it's not already there and click OK.
01:25For our star's stroke, let's choose black and for the sill, let's choose yellow.
01:32Click and drag to draw your star and before you release the mouse, try to have
01:35one of the seven points pointing straight down.
01:38You can rotate your star afterward with the Free Transform tool if you don't get
01:42the rotation right off.
01:44Don't worry too much about the size.
01:46Once you've got your star, switch to your Arrow tool and double-click the star,
01:50so you're sure to get the fill and the stroke.
01:52Than in the Property Inspector, under Position and Size, make sure the little
01:56icon of the chain looks like a connected chain.
01:59If it's a broken chain, click it so that as we change the width, the height will
02:02change proportionally.
02:04Type in 100 for your width.
02:11Let's zoom in on our star for the next step.
02:15Now we'll copy our yellowSun and then rotate and change the color to orange for the copy.
02:20Go ahead and select your star and then hit Command+ or Ctrl+C on your keyboard to copy.
02:26Now lock your yellow star layer and click in Frame 1 in the orangeSun layer.
02:32Go to Edit menu and choose Paste in Place.
02:35Press Q on your keyboard to bring up the Free Transform handles on the star and
02:40then rotate it so the points are juxtaposed with the star behind it.
02:43If you can't get the star to line up just how you'd like, go to the Window menu
02:51and choose Transform.
02:54The Transform panel comes up and next to Rotate, you can click and drag the
02:57number indicating the rotation to the right or to the left to rotate the star slowly.
03:02Once you're happy with your rotation, grab the Arrow tool, click on a blank part
03:06of the stage to deselect everything and then click once on the fill.
03:10In the Property Inspector, change the Fill color to orange FF9900.
03:15Now we need the circle for the sun's face.
03:18Lock the orangeSun layer and select Frame 1 of the sunCircle layer.
03:22This part will be easy.
03:23In your tools, choose the Oval tool.
03:25The stroke is already set to black, so just change the fill to the same yellow
03:29color we used for our star, FFFF00.
03:31Draw a circle that nestles in the center of the sun.
03:36Remember that you can hold down the Shift key as you draw to have the dimensions
03:39of the circle remain proportionate to each other.
03:45Adjust the position of your circle and when you're done, lock your sunCircle layer.
03:49All we have left to do is to place the sun's face.
03:52We imported this into our library, as a vector Illustrator file previously.
03:57So select Frame 1 of the sunFace layer, open your Library and drag face to the stage.
04:03Use your mouse or your Arrow keys to position the face to your liking and we're done.
04:08So our sun looks good and if you've zoomed in as you worked, now might be a good
04:12time to change the zoom back to Fit in Window.
04:17Let's test our movie and indeed the sun appears and persists during the
04:21entire 96-frame movie.
04:29Go ahead and close your SWF.
04:30Now there's only one thing we might want to do as we go along.
04:33While it's good that each part of the sun has its own layer, if you don't like
04:37the position of your sun, you have to unlock all four layers, hit Command+ or
04:41Ctrl+A to select all of the sun assets and then move them all at once.
04:46While that's okay, a better solution would be to have all the shapes move as a
04:49group to prevent accidents. So let's try it.
04:54With all of the sun assets selected on all four of the layers, hit Command+ or
04:59Ctrl+G. Now try to move the sun using your arrow keys and you can see there just
05:04one of the layers moves.
05:07Our sun pieces weren't grouped together because they're on different layers.
05:10So grouping only works for items all on one layer.
05:13We really do want to keep things on separate layers because we're going to
05:17animate the sun down the line.
05:18So for now we're just going to leave it the way it is.
05:21So go ahead and lock all of your sun layers again and we're done.
05:25We've used a lot of the different drawing tools here, but if you want a
05:28detailed explanation of all the drawing tools and all their options, check out
05:32the Flash Essential Training courses by Todd Perkins here in the lynda.com
05:36Online Training Library.
Collapse this transcript
Creating shapes in Object Drawing mode
00:00Object Drawing mode essentially draws shapes on the stage that are already
00:04grouped together for you.
00:06To explore Object Drawing mode, I'm going to add a speed limit sign to our
00:10fastCar project to tell the car driver that the speed limit is 40.
00:14Here I'm working in my fastCar.fla file from before.
00:18The first thing to check is to make sure that all the layers under the
00:21visualContent folder are locked.
00:24Our speed limit sign should appear in the second half of the movie that begins
00:28on Frame 49 and also have its own layer.
00:31So I'm going to find and select my movingCar layer and add a new layer above it.
00:36Then rename it, to "speed limit sign."
00:39Now I'm going to select Frame 49, right- click and choose Insert Blank Keyframe.
00:46Now I'm going to use my Rectangle tool but before drawing, make sure that we're
00:49using Object Drawing mode.
00:51Notice the little icon that looks like a little circle within a square in the
00:55Properties area, underneath the toolbar.
00:58Remember that this icon is how to toggle between Merge and Object Drawing modes,
01:02and that the lighter color of the icon indicates Merge Drawing mode.
01:07Click on the icon to make sure it's darker gray, so that you're in Object
01:10Drawing mode, and with that done, let's set the stroke for our rectangle to
01:15black and the fill to white.
01:18Let's make the stroke for our sign little bit thick.
01:21So use the Strokes slider to change it to 3 or you can just type in 3, if you prefer.
01:27Also under Rectangle options, we can make a rectangle corners be more or less rounded.
01:33Make sure the little image of the chain looks like it's unbroken.
01:37This way all the corners will use the same value for their corner radius and
01:41now type 5 in the box.
01:43The others should follow suit.
01:45Draw a vertical rectangle on the stage kind of over on the left side about yea big.
01:50The size doesn't have to be exact.
01:53Notice immediately in the Property Inspector that we're looking at a drawing object.
01:58If this were Merge Drawing mode that would say shape.
02:01So now when I use my Arrow tool and drag the rectangle around, you'll notice
02:05that the outline or the stroke and the fill move around together.
02:10You can't select either one of them separately like you can with Merge Drawing mode.
02:13Now I'm going to click on a different part of the stage to deselect and get
02:18ready to draw a pole to hold the sign up.
02:21We've talked about how a best practice is to have each visual piece on the
02:24screen be on its own layer.
02:26In this case, I'm going to break this guideline and have the pole and the
02:29sign in the same layer.
02:31My reasoning is that I don't anticipate animating the sign in any way so we
02:35don't mean to maintain individual layers for that.
02:38If I want to move the sign around on the stage, I'll want to move all the pieces together.
02:42By having them all on one layer, I can easily group them and move them around.
02:47So in this case, having related visual objects all together in the same layer
02:51seems like an okay thing.
02:53This is going to be a wooden pole.
02:55So I'm going to go back to my Rectangle in the toolbar and in the Property
02:58Inspector change the fill to brown.
03:00I'm going to choose 663300.
03:04The stroke thickness can be made very thin.
03:06So let's type in 0.10 here.
03:10Also let's change the corner radius setting down at the bottom back to 0, so our
03:14rectangle pole has sharp corners.
03:17Now I'm going to draw the pole underneath the sign.
03:20I'm going to use the Arrow tool to move the pole on top of the sign and then I'm
03:25going to click a blank part of the screen to deselect everything.
03:28Now I'm going to move the pole away again.
03:32Notice that both rectangles remain in their own discrete shapes.
03:35If this were a Merge Drawing mode, the area of the sign that had been covered by
03:39the pole would have been chopped out.
03:42You can see how Object Drawing mode really lives up to its name.
03:45Each shape you draw is its own individual shape, unaffected by others on the same layer.
03:50This is unlike Merge Drawing mode.
03:52Even though it's a discrete object, you can still modify a drawing object easily.
03:56For instance, I can click on the white rectangle and in the Property Inspector
04:00easily change the fill to something else.
04:02I'm going to change it back to white.
04:06Now I'm going to click on the stage to deselect everything and approach one side
04:10of the rectangle with the mouse.
04:12Notice the little icon of the curved line that appears.
04:16This allows me to drag the edge of the shape out to modify it.
04:21I'm going to undo this change, but know that you can further edit your drawing
04:24objects by double-clicking on them to step into the group.
04:29Notice how at the upper left of the timeline, it now says Scene 1 and
04:32then Drawing Object.
04:34Additionally, everything back up on the main timeline looks faded out.
04:37Now that we stepped into the drawing object, I'm going to select the fill of the rectangle.
04:42Look in the Property inspector, it says Drawing Object.
04:46Now I'm going to select one side of the stroke and notice that the Property
04:49inspector still says Drawing Object.
04:52However, the behavior is really that of simple shapes.
04:55I can select and move the stroke away to the right all by itself, or I could
05:00select the fill individually and move that away as well.
05:03I'm going to try moving the fill on top of some of the stroke and then click
05:07the stage to deselect.
05:09I'm going to move the fill away and you'll see that the stroke that was covered
05:12up is now cropped off.
05:14Indeed, our items on the screen here are behaving like shapes.
05:17I'm going to undo all of these changes and then click Scene 1 to return to the
05:22main timeline again.
05:24So you can see that what Object Drawing mode really does for you is group the
05:28fill in stroke of a shape for you automatically when you draw the shape, instead
05:32of you having to do it yourself.
05:34This can be a great convenience, but if you find yourself wanting a drawing
05:37object to behave more like a merge drawing object, after you've created it,
05:41simply select the shape, right click and choose Break Apart.
05:45When you do this, the fill and the stroke are both turned into shapes which we
05:49can see by looking in the Property inspector.
05:51So I'm going to adjust my pole as necessary to make sure that it looks good and
05:56then click somewhere on the stage to deselect.
05:58I'm going to finish out the sign by adding some text.
06:01We'll go into the details of using the Text tool a little later on.
06:05For now, I'm going to type Speed Limit 40.
06:20Our final step is to group all the sign parts together.
06:23You can use your Arrow tool to draw a box around all three objects, which
06:26selects all of them.
06:28Or you could use Command+A or Ctrl+A on your keyboard to select all on this layer.
06:34With the sign parts selected, I'm going to go to Modify menu and choose Group.
06:38Alternatively, you can hit Command+ or Ctrl+G to group the pieces together.
06:42I'm going to adjust the final position of my sign and notice in the Property
06:47Inspector that it shows we're working with a group.
06:49If you want to adjust the individual pieces again, you can either go to
06:53Modify and then Ungroup or you can just double - click on the group to step into it, like so.
06:59Since I'm done with my adjustments, I'm just going to click on Scene 1 to return
07:03to the main timeline and now lock the speed limit sign layer.
07:07I'm going to go ahead and test the movie to see the finished result.
07:10The entered text appears for the first four seconds, and then for the last four
07:15seconds we see the speed limit sign ready to warn our driver.
07:18She'll be animating onto the screen from right to left soon.
07:23So Object Drawing mode is really just a convenient way to have a shape's stroke
07:27and fill grouped together for you when you draw the shape.
07:30If you want a detailed explanation of all the drawing tools and all their
07:34options, check out the Flash Essential Training courses by Todd Perkins here in
07:39the lynda.com Online Training Library.
Collapse this transcript
Transforming visual objects
00:00So far we've seen a few different ways to transform objects on the stage.
00:04We will take a more in-depth look here at different ways to transform visual
00:07objects, so you can add more tools to your toolbox.
00:10Open the file called rocketToMars.fla in your Exercise Files.
00:15First we will look at some of the options under the Modify menu.
00:19Click on one of the big yellow stars on the right side of the stage.
00:22If you open your Property Inspector, you'll notice that this is just a shape.
00:26Note that the top point of the star is kind of pointing to the right and now go
00:30to Modify menu and then choose Transform and then Flip Horizontal.
00:36The stars flipped over and it's the mirror image of itself.
00:38Note that the top point is now kind of pointing to the left.
00:41You can compare it to the other big stars if you need to as well.
00:44So now I'll select the rocket on the stage and to do a similar thing, go to the
00:49Modify menu, choose Transform and Flip Vertical.
00:52Now that seems pretty straightforward so let's move on and I'm going to
00:57select the big star again.
00:58I am going to open the Modify menu and then Transform again.
01:03The choices of Distort and Envelope give you slightly different options for
01:07different ways you can change the shape of your star.
01:09All of the other options left here you can also access by using the Free
01:13Transform tool from the toolbar.
01:14So I am going to go ahead and select my star and grab the Free Transform tool.
01:20You could also just hit Q on your keyboard and you will see the
01:23transformation handles appear.
01:25You can use those Free Transform handles to Scale, Rotate and Skew.
01:29I am going to mouse over this control point with my mouse and wait for that
01:33double-headed arrow to appear.
01:35You can drag like so to scale the vertical dimension or the
01:38horizontal dimension.
01:40If you want to scale both dimensions at once, you can do that, and if you hold
01:43down the Shift key, both dimension scale in proportion to each other.
01:49I can rotate an object by approaching one of the corners until I see the
01:53circle arrow and then just drag around.
01:57Finally to skew, approach one of the edges with the mouse until you see the Skew
02:01icon appear and skew away.
02:05Making sure my star is still selected you could go to the Window menu and choose Transform.
02:13Alternatively, you could hit Command+ or Ctrl+T. The Transform panel appears
02:18and you can control the scale, skew and rotation from here as well.
02:22I will make sure that my star ends up a little bit smaller than the others.
02:26So you can see there's a lot of control and information offered to you through
02:31the panels and the Free Transform tool.
02:33So moving on, lining up things in your Flash movie is easy as well.
02:38To get out of Free Transform mode, just click on your Arrow tool in the toolbar.
02:42Now I am going to hold down my Shift key and select all three of the big stars
02:45at the same time so we can align them.
02:48The Align panel is under the Window menu then Align or you could hit Ctrl+ or
02:53Command+K on your keyboard.
02:55There are a lot of choices in the Align panel as you can see.
02:59For instance, you could align your stars left, center or right.
03:06Let's have an even amount of space between all the stars.
03:09For this, I am going to choose Distribute Center.
03:12You also have some interesting controls in Match size.
03:16Flash looks at all the selected objects and then has all of them match the
03:19size of the largest.
03:21So here I will match the width and then match the height and you can see the effect.
03:26Finally notice this little checkbox that says Align to stage.
03:30When I've aligned my stars so far, Flash aligns them relative to each other.
03:34If you check Align to stage and then align left, the objects are left aligned
03:38relative to the dimensions of the stage.
03:41Let's now play a little bit with fills.
03:44You've probably already seen how you can select an object like our red Mars
03:48planet and in the Properties panel click on the fill color chip to change the
03:52fill to something like yellow.
03:55Now with my planet still selected, I am going to pop open the Color panel by
03:58clicking on the icon of the Paint palette.
04:02Notice the top dropdown which says Solid and this makes sense since Mars is
04:06currently a solid yellow color.
04:08When I change my dropdown to Linear Gradient, then you will see that we now have
04:12a gradient blend of two colors that go from one into the other.
04:17You could also try changing your Gradient dropdown from Linear to Radial to make
04:21the gradient more circular.
04:24You could also change the colors used by clicking on the color indicators here.
04:31I think Mars should be a little bit more red so I am going to swap the positions
04:35of these two color indicators.
04:36There are a lot more controls available to you regarding gradient fills here
04:42and in the Gradient Transform tool, which is under the regular Free Transform tool here.
04:48You can play with these on your own or for an in-depth guided tour, check
04:52out the Flash Essential Training courses here in the lynda.com Online Training Library.
04:56I am going to open my Color panel one more time and in the Gradient
05:02dropdown, choose Bitmap fill.
05:06As the name implies, this allows you to use a bitmap fill to fill up your object.
05:11Flash asks you where the image you want to use is located and there's an image
05:15called mars.png in the start folder in the Exercise Files.
05:25Click Open and then click on the stage to deselect and that now you can really
05:29see the image applied is the fill for Mars.
05:32So we have seen here some of the main ways you can transform visual objects in Flash.
05:36Using panels, as well as all the options for the Free Transform tool, and
05:40gradients, are all powerful ways to make your visual objects engaging for
05:44your users.
Collapse this transcript
4. Understanding Symbols
Introducing symbols
00:00One core concept that you'll use over and over again in Flash is Symbols.
00:04Symbols are basically reusable visual assets and you'll see them as building
00:08blocks for animation and interaction.
00:10Let's jump in and practice with symbols.
00:13So, our first step is to open a new blank FLA document.
00:16Now, I am going to draw a simple circle shape on the stage and make it a symbol.
00:20I'll select the Oval tool and for this example I am going to have a circle with
00:24a red fill and a black stroke.
00:26Now, I'll draw my circle on the stage, and if you click on your shape and
00:30open the Property Inspector, it tells us that this blob of color on the stage is indeed a shape.
00:36This is what we're using for our example here but know that you can make almost
00:40anything into a symbol; shapes drawn and Merge or Object drawing modes, bitmap
00:44images or whatever else.
00:46So, notice that the Library remains empty.
00:48We won't actually see anything in the Library until we convert our shape into a symbol.
00:53So, there are multiple ways you can do this.
00:55The first is to select the entire shape, being careful to select the fill and
01:00stroke, and then dragging it to the Library.
01:02You get a dialog box asking for information about the new symbol.
01:06I am going to cancel out of the box for now.
01:09You could also select the entire shape and then right-click to choose Convert to Symbol.
01:16I'll cancel out of the dialog box again.
01:19You can also select the shape on the stage, then go to the Modify menu, and
01:23choose Convert to Symbol, or of course, you could just press F8.
01:27Any of those methods work, and so now we'll give Flash some information about the symbol.
01:32Let's give it a name of "Circle," and in this dropdown, let's make it a Movie Clip.
01:36Also notice the Registration point of our new symbol.
01:40The X and Y position on the stage is going to be measured from this point.
01:45The default is the upper-left corner.
01:47You can make your symbols have their registration point anywhere you want to, but
01:51I'd recommend picking one and sticking with it for all symbols you create, so
01:55the registration point is consistent across all of them. Now click OK.
02:00You should notice that two things have happened.
02:02One is that we now have circle show up as a symbol in the Library.
02:06The second is that when we click on our new movie clip symbol and open the
02:09Property Inspector, it shows us that this is an instance of that Circle movie clip.
02:15It also tells us the X position of 239 and the Y of 134.
02:21Remember that we chose to have the Registration point beyond the upper left of
02:25the symbol and if we quickly turn on our rulers by going to the View menu and
02:29choosing Rulers, you can confirm the X and Y position by looking at that upper
02:34left-hand corner registration point. So cool!
02:37We have this symbol but why is it useful?
02:40Let's try dragging and dropping another two copies of this circle out of the Library.
02:45Think of this symbol in the Library as a blueprint for the circle.
02:49Each time you drag a new one out to the stage, you're making another copy, or as
02:53the nomenclature is in Flash, you're creating another instance.
02:56It's the same concept as maybe a blueprint for a house.
03:00You have one set of plans for a house and if your neighborhood is like mine
03:04you'll have several instances or copies of that house built in the neighborhood.
03:08Instead of drawing items on the stage over and over like a bunch of raindrops or
03:12an army of robots, you can just use copies of the blueprint.
03:15This not only saves you some work but it can also save you on file size.
03:19Let's delete two instances of our circle from the stage to demonstrate this.
03:24Now, publish your movie.
03:27You can close the SWF file right away.
03:29What we're interested in is the final file size of this baseline movie.
03:33So, we can do that by clicking on the stage and opening the Property Inspector.
03:37Here, in SWF History, we see that our movie was 656 bytes. All right!
03:42So, let's say we need two more circles.
03:44I am going to grab my Oval tool again and draw a second circle and of course a third circle.
03:49I am not going to turn them into symbols, just leave them as shapes on the stage.
03:54Now, I am going to republish and again close the SWF right away.
03:59Back in the FLA, I am going to click on the stage and look at the
04:02Property Inspector.
04:03Our final file size with the three circles is 818 bytes.
04:07So, now I am going to compare using symbols.
04:09I am going to delete the two shapes off of the stage and now drag two more
04:13instances of this Circle movie clip from the Library.
04:16I am going to publish the SWF, close the SWF, and then open the
04:23Property Inspector.
04:24Our final file size this time is 680 bytes, smaller than when we had circles we
04:29had just drawn on the stage and that's part of using the power of symbols.
04:33Our file size is smaller when using multiple instances of the symbol because
04:37Flash only has to remember the definition of the circle once.
04:41Each copy on the stage points back to the symbol as opposed to Flash having to
04:45remember a separate definition for each circle.
04:47Of course, in our example here the difference in file size is not all that
04:51dramatic but hopefully you can project that file size savings could really add
04:55up when you're dealing with maybe multiple copies of complex artwork or bitmaps
05:00or in a case where you need a whole colony of prairie dogs or maybe a forest.
05:04So, there's another thing to know about symbols.
05:06Each individual instance can be modified but they're all still tied back to the
05:10blueprint in the Library.
05:12Just like you can have three houses built from the same blueprint but paint each
05:16one a different color, so they all look different.
05:19Here's what I mean.
05:20Let's select one of our Circle symbols on the stage and modify it.
05:23I am going to press Q on my keyboard, so the transformation handles appear
05:27around the instance of the circle and I am going to shrink it a little bit and skew it.
05:30Now, I am going to grab my Arrow tool and selecting a second instance of this
05:36circle, I am going to open my Properties panel.
05:39Under Color Effect, I am going to choose Alpha.
05:42I'll change the Alpha to 50%, so the circle looks faded out.
05:47You can see here that each one of the instances of this symbol can be modified,
05:51so they each look different but they're all still tied back to the symbol in the Library.
05:56You can see this when you double-click on one of the instances on the stage.
06:00Any one of the three is fine.
06:02The screen changes and you'll notice that at the top of the screen it says
06:06Scene 1 and then Circle.
06:07This is indicating that we stepped into the timeline of this Circle symbol.
06:11You can also see the other instances of this circle on the stage are now kind of faded out.
06:16This is called Edit In-Place mode.
06:18I am editing the Circle symbol definition right in place where it was on the stage.
06:22Yet, we can still see where that instance is relative to the other stuff on the stage.
06:27So let's change our Circle symbol definition.
06:29I am going to click on the fill of the circle and change it to blue.
06:34And as soon as we do that, you'll see that all the instances on the stage
06:37reflect the change made to the blueprint.
06:39To step out of Edit In-Place mode, let's just click on Scene 1 at the top of the
06:43screen, so we're back on the main timeline.
06:46There's also another way to edit a symbol.
06:48Instead of double-clicking on an instance on the stage, I am going to
06:51double-click on the symbol in the Library.
06:53Be sure to click on the little picture of the cog not the name, otherwise Flash
06:57will think you're trying to rename the symbol.
07:00Here, you can see that once again we're in Scene 1 and then Circle.
07:04So, we've stepped into the timeline of this Circle blueprint, but since we
07:08double-clicked on the symbol in the Library to edit, this time we don't see all
07:11the other stuff sitting on the stage in the background.
07:14This is called Symbol Editing mode.
07:17So, let's select the fill of our circle again and this time change it to green.
07:23Now, click on Scene 1 at the top of the screen to go back to the main timeline
07:27and you'll see yet again how our changes to the blueprint have been reflected in
07:30each one of the copies, and then of course, each one of the copies can be
07:34further modified individually but the basic structure of each one points back to
07:39the Circle movie clip symbol sitting in the Library, which now has a green fill.
07:43One best practice to keep in mind as you work on projects is to periodically
07:47clean out and organize your Library symbols.
07:49For instance, here I am going to click the Folder icon in the Library to create
07:53a Shapes folder and drag my Circle symbol into it.
08:00If you come to the end of a project and have Library symbols that aren't
08:03actually used in your movie, deleting them out of the Library will make it much
08:07easier to figure out what's actually used in the movie than when you open the
08:10FLA, say, four months down the road.
08:13Also, naming each symbol something intuitive and descriptive like "Circle" is much
08:18better than the default name Flash will come up with, which is usually something
08:21not very unique like symbol 1, symbol 2, symbol 3.
08:25I once bought a Flash template that had been originally developed by someone else.
08:29Not only were the symbols named things like symbol 1, symbol 2, symbol 3 but
08:33there were multiple copies of the symbols in the Library.
08:36The symbol copies were almost all exactly alike, so it was really hard to tell
08:40what was actually being used in the SWF.
08:42It was a horrible time waster to sort that out all.
08:45So, whether you need to have a bunch of Smurfs on the stage or just need a
08:49good way to organize your movie's content, I hope you can see some of the
08:53advantages of using symbols.
08:55There's more than just one kind of symbol in Flash and we'll explore the
08:58differences between them in the next movie.
Collapse this transcript
Working with movie clips and graphic symbols
00:00There are three different types of symbols in Flash.
00:03Let's take a look at two of them that are similar to each other;
00:05Movie Clips and Graphic symbols and discuss why you would use each one.
00:09Let's start with a new blank FLA document and examine the Movie Clip symbol first.
00:14Let's draw our star so I'm going to grab my PolyStar tool and now in the
00:18Property Inspector under the Tools Settings, choose Options.
00:23Under the dropdown, I'm going to choose star since I don't want a polygon and
00:27I'll make it have five sides or points.
00:29Let's give it a black stroke and a yellow fill and draw the star on the stage.
00:36Now to convert it to a symbol, you may remember from the previous video that
00:40there are a lot of ways to do this.
00:41For now, I'm going to select the shape with my Arrow tool, right-click and
00:45choose Convert to Symbol.
00:46The Convert to Symbol dialog box appears.
00:49So I'm going to give my symbol a name that makes sense, so "star" and make sure
00:54the dropdown is set to Movie Clip and click OK.
00:58So now if you open your Library, you see the star movie clip appearing there and
01:03if I select the Movie Clip symbol on the stage and open the Property Inspector,
01:07yeah, it tells me that this is a movie clip and it's an instance of star.
01:11There is one other important thing to note here and that's the spot where
01:15it says Instance Name.
01:17I can type in a name here for my symbol, maybe "myStar."
01:22And what this does is give Flash a hook into the symbol instance if I want to
01:27control it using ActionScript.
01:29Say I had five different stars on the stage and I wanted to control only one of
01:33them with ActionScript.
01:34Well, how is Flash going to know which one I want to control?
01:37The Instance Name is the hook you use to connect ActionScript and individual
01:41movie clips on the stage.
01:42Once Flash knows which symbol on the stage you are trying to talk to, you can
01:46move it, rotate it, scale it, make it fade in and out, make it clickable and a
01:50number of different other things with ActionScript.
01:53We don't need to control the star with ActionScript right now, but there's one
01:56more thing to note about the Movie Clip symbol.
01:59Let's double-click on the star movie clip and you will notice on the upper-left
02:02hand of the screen it now says Scene 1 and then star.
02:07As we've seen before, we've actually stepped inside our star movie clip.
02:11You can see that it has its own timeline just like the main timeline, it can
02:15have its own set of layers so we can add an extra layer or two here.
02:19It can have its own keyframes, its own animation, whatever you want.
02:23Each movie clip having its own timeline is a really powerful feature, both in
02:27terms of ActionScript and animation.
02:30Breaking things into individual pieces as movie clips means you can control
02:34different parts of your Flash movie separately and we will explore that a little later on.
02:38For now, let's click on Scene 1, back on the upper-left again and go back to the main timeline.
02:43For now, know that Movie Clip symbols are useful because they have their own
02:47timelines, they can be animated and ActionScript can communicate to them via an Instance Name.
02:53In fact, the entire Flash FLA document is a movie clip of sorts.
02:58Movie Clip is the most versatile and powerful of the three symbol types.
03:02Let's move on now to our second type of symbol, a Graphic symbol.
03:06For this, I'm going to draw another shape, this time a circle.
03:09So grab your circle or Oval tool and give it a red fill with a black stroke.
03:13Draw your oval and then select it and now I'm going to right-click and choose
03:21Convert to Symbol and give it an intuitive name so how about "Circle" and this
03:26time make it a Graphic symbol.
03:30Open your library and the Circle symbol appears.
03:34Notice also the difference in the icons, next to the symbols.
03:38The star movie clip has an icon that looks like a gear the circle is more like a
03:42conglomeration of shapes.
03:44Now double-click on the Circle instance on the stage and you will annual notice
03:48again how at the top-left it says, Scene 1 and then Circle.
03:50So once again, we have stepped inside the symbol to its own timeline.
03:55So I can select my fill here and change it to green.
03:57I could make the circle bigger I could skew it, rotate it, do all kinds
04:01of different things.
04:02The thing to notice here is that Graphic symbols just like Movie Clip symbols,
04:07have their own timeline and you can edit the content on that timeline as well as animate it.
04:12So let's click Scene 1 back in the upper left again, to step out of that
04:16Graphic symbols timeline.
04:19So what's really the difference between Movie Clip symbols and Graphic symbols?
04:22So far they look about the same and they both have their own timeline, and they
04:27can both be animated.
04:28Well, one big difference is that Graphic symbols can't be directly
04:32manipulated by ActionScript.
04:34For instance, if I wanted to make my circle clickable, well, I can't, because
04:39it's a Graphic symbol.
04:40To prove it to you, click on that Circle instance to make sure it's selected
04:44and open up the Property Inspector, and indeed, here it shows it's a Graphic
04:48symbol called Circle, but there's no field to type in an Instance Name like
04:53there was for movie clips.
04:54If there's no Instance Name, Flash can't identify it to manipulate it with
04:58ActionScript, and that is really the biggest difference between movie clips and graphics.
05:03There are some other differences and tricks between movie clips and graphics,
05:06when it comes to control of timeline animation and we'll talk about that later
05:10in this section about tweening.
05:12So when you're trying to decide, should I make my new symbol a movie clip or a
05:17graphic, just keep in mind if you think you might ever want to make the symbol
05:21clickable or otherwise control it with ActionScript, make it a movie clip.
05:25Graphic symbols are a better choice to contain maybe something like a background
05:29graphic that's just going to do something simple, like fade in and out or an
05:33animation that's very simple.
05:35So there we have two very commonly used symbol types, Movie Clips and Graphics.
05:40To review, they both have their own internal timelines and are best for creating
05:44animation or acting as containers for visual elements.
05:48But only Movie Clips can be given Instance Names in order to become clickable or
05:53otherwise be controlled by ActionScript.
Collapse this transcript
Introducing buttons
00:00Let's take a look at the third and final type of symbol in Flash, the Button symbol.
00:05Open up a blank FLA file, and let's create a button by grabbing our Rectangle
00:09tool, choosing a blue fill, and then under Rectangle Options, I'm going to bump
00:14up my rounded corners measurement here, so we get slightly rounded corners.
00:18Then, we'll draw a rectangle on the stage.
00:20Now, with my Arrow tool, I'm going to select the rectangle shape, right-click,
00:24and choose Convert to Symbol, and let's give it a name of Rectangle.
00:28Make sure you've selected Button from the Type dropdown.
00:33Flip over to your Library really quick and you will see, aha!
00:35Yup, there is my new Button symbol.
00:39Now, let's double-click on the instance on the stage to go into the button's own timeline.
00:45You'll notice that just like with the other symbol types, on the upper-left it
00:48says Scene 1 and then Rectangle.
00:51So we've stepped into the button, we're editing its timeline.
00:54You can see that a button timeline is different than that of a movie clip, or a graphic symbol.
00:59We've got four frames here, each one that has to do with what the user's mouse is doing.
01:04So the first keyframe shows what the button will look like when the user's mouse
01:07is up, or unclipped.
01:09Basically, what the button looks like when it's just hanging out on the stage.
01:13The next frame is for what that button will look like when the user's mouse is
01:16hovering over the rectangle.
01:18Well, let's give our users some nice visual feedback when they mouse over our
01:22button by changing the color.
01:24So the way we do that, is in the Over frame, we will right-click and choose
01:28Insert Keyframe, and indeed, Flash created the keyframe, you can tell by the
01:32filled in black circle in the Over state.
01:35Flash copied the information from the Up frame into the Over frame.
01:39So right now, Up and Over look exactly the same.
01:43So making sure you have the Over frame selected, let's click on the fill of the
01:47rectangle, and change it to red.
01:52Now, let's do the same thing for the Down keyframe.
01:54Let's change the color of the button when the user's mouse is pressed down.
01:58Right-click on the Down keyframe, choose Insert Keyframe, and select the fill in
02:03the rectangle, this time, change it to green. Voila!
02:06Let's test our movie by pressing Ctrl+ Enter and indeed, when the mouse is up or
02:12just not touching the rectangle, it's blue, when it's over, our button turns
02:16red, and when I click down with my mouse, it's green.
02:20So what if you want your button to have some text?
02:22Well, that's easily done.
02:23So let's close the preview, and back on our Button timeline, let's add a
02:27layer to our button.
02:30You can have as many layers in the timeline of your button symbol as you want,
02:33just like the main timeline.
02:35Let's grab our Text tool, and set some settings.
02:38I'm going to choose Arial, Bold, Italic, 16 points is fine, and then I am going
02:46to make my text black.
02:47Move your playhead to the Up keyframe, and now click on the stage and type the
02:52words Click Me on top of your button.
02:55Go ahead and adjust the position with your mouse or your Arrow keys.
03:02So you can see that Flash filled-in the words Click Me on the Over and Down
03:07frames as well and now if you hit Command+ or Ctrl+Enter to test your movie, you
03:12now see your nice button with the text working properly.
03:14So that's a handy way to quickly create a button that reacts to what the user is doing.
03:22Let's close our preview and go back to the Button timeline and delete the text
03:26layer, so we can look at something else.
03:28So we've got Up, Over, and Down, what about the Hit state of the button?
03:33Hit, as the name kind of implies, defines what area of the button is hot or clickable.
03:39Notice that even though there is no keyframe in the Hit frame, Flash is
03:43looking back to the closest previous keyframe that has something drawn in it, and using that.
03:49So in our case, it's looking at the Down keyframe.
03:52And you know, it's fine to leave a button this way.
03:54You don't have to define the Hit state.
03:56You don't even have to define Over and Down if you don't want to.
04:00If you just have a keyframe on the Up state, and nothing on the other
04:03frames, your button will just always be blue or whatever you have defined in the Up keyframe.
04:09Having that Hit state can be nice for some alternative options though.
04:13Maybe you want the button to highlight when the mouse just gets close to it
04:17but not on it, so the Hit area being a little bit bigger than the actual
04:22colored part of the button.
04:23This can be useful in maybe something like a children's game where the child is
04:27still practicing using the mouse, and having that extra hit area makes it easier
04:31for them to actually get the mouse on the button. So let's try it.
04:35Right-click in the Hit state, and choose Insert Keyframe.
04:41Now, select the rectangle and let's Hit Q on our keyboard to bring up the
04:45Free Transform handles.
04:46I am going to scale my Hit area a little bit bigger, and then use my Arrow keys
04:53to center it on the stage.
04:55Now, if you test, you can see that when the mouse gets close to the colored
04:58area, but not quite on top of it, the button starts reacting because the Hit
05:03state is bigger than the colored area.
05:05Let's close the SWF and go back to the FLA.
05:08Another thing you could do is go back to your Hit state and move the rectangle
05:12to a totally different area of the screen.
05:14Now, publish and see what happens.
05:16The button doesn't react until I touch the Hit state way over here with my mouse.
05:21This could be really useful or really annoying to your user, depending on what
05:25you're trying to do.
05:26One more useful thing, kind of building on that, about the Hit state is being able
05:30to create an invisible button.
05:33Invisible buttons can be very useful.
05:35You can use them to make any area of your screen hot.
05:38So maybe you have an area of text that you want to be clickable, or if the
05:42user clicks on a certain part of an image and a sound is played, or text
05:45appears or whatever.
05:47If you've ever studied banner ads like advertisements you see on websites,
05:51you've probably noticed how you can click on almost any part of the ad and
05:54then something happens.
05:55Well, banner ads usually have the whole ad or at least a large part of it
05:59covered with an invisible button, so it's super easy for the user to click on.
06:04So I'm going to close my preview and go back to my Button timeline and hit
06:08Ctrl+Z to undo my Hit state.
06:11It should be back in its original position and the same size as the rectangles
06:15on the Up, Over, and Down stages.
06:18Now, I'm going to right-click on the Up frame, and choose Clear Frames which
06:22clears out the frame's content.
06:23Then, I will do it two more times to get rid of the other two keyframes.
06:28So now Up has a blank keyframe, Over and Down have nothing in them at all, and
06:32Hit is the only keyframe that actually has something on the stage.
06:36Now, in the upper-left, click Scene 1 to go back to the main timeline, and
06:39you'll see that your button appears as a light blue.
06:42This is only for you as the developer to remind you that there's an
06:45invisible button there.
06:47If you test your movie, you will see that the button doesn't appear at all.
06:51However, I know it's still there, because when I mouse over where the button is,
06:54my cursor turns into the little hand instead of the arrow.
06:59Button symbols just like movie clips can be controlled by ActionScript too.
07:03Close your test movie, then grab your Arrow tool and click on your button.
07:08Open the Property Inspector and you'll see the field for adding an Instance Name appears.
07:14Again, that's Flash's hook into the symbol to control it with ActionScript.
07:18This makes sense, our button already changes color, but if you want the button
07:22to actually do something when someone clicks on it, like open a new window or
07:26make your Flash movie do something, you need to have ActionScript.
07:30Here's a quick tip for you.
07:32If you're like me and you aren't good at drawing buttons that look pretty, you
07:35can go to the Window menu, then choose Common Libraries and then Buttons.
07:40A panel opens up with a library of buttons you can choose from.
07:43So you can go ahead and just browse through them at your leisure.
07:47Click on any of them to preview.
07:59Once you've found one that you like, simply drag it and drop it to the stage.
08:03If you look in your Library, you will see that there's now a folder that has the
08:06assets that make up that button.
08:09So here in Arcade Buttons, there is the actual button symbol itself.
08:13So there we have it, the Button symbol.
08:15The Button symbol special timeline makes it easy to create buttons that respond
08:19in a visual way to user interaction.
08:23And by giving buttons an Instance Name, they can also be controlled
08:26by ActionScript.
Collapse this transcript
Adding buttons to a project
00:00Let's use all the background information we've seen about symbols to make some
00:03buttons for our lady driving the fast car.
00:06Open fastCar.fla, and to refresh ourselves on what we have so far, let's test
00:11our movie by pressing Ctrl+Enter.
00:14We have our 4 second intro with the title text, and the lady in her car in the
00:17middle of the screen.
00:18Then, we have 4 more seconds where the speed limit sign is displayed and a blank
00:22spot in the middle where the car will drive.
00:24The buttons need to appear during that last 4 seconds.
00:30In your FLA, move your playhead over to Frame 49 where the last half of the movie begins.
00:36Remember, we have our moving car layer, even though the car doesn't move yet,
00:41and the speed limit sign layer.
00:43Make sure all the layers in the visual content folder are locked, and now since
00:48we want the buttons to appear at the same time as these items, click the title
00:53of the speed limit sign layer and then add a new layer above it.
00:58Let's rename this new layer, "Buttons."
01:01Now, on Frame 49, add a blank keyframe.
01:06We need 4 buttons that are just going to have text in them.
01:09Let's type the text first and then convert into buttons.
01:12So grab your Text tool from The toolbar, and in the Property Inspector, make
01:16sure you have Classic Text selected in the first drop-down, and Static Text in the second.
01:21For your Font, I suggest Arial Bold at 18 points and the color being yellow.
01:26On your stage, type "stop," then in a new textbox, type "go."
01:32In the third textbox, type "start over," and the final box should have "buy action figure."
01:46Double-check at this point that your text is on the Buttons timeline during the
01:49last half of the movie;
01:51so Frame 49 and later.
01:54If you've somehow got the text appearing on Frames 1 through 48, cut and paste
01:57it over to begin at Frame 49.
01:59Now, let's line these up.
02:01Position your start, so that it's roughly lined up with the speed limit sign,
02:05and then move "buy action figure" over, so the white line in the road is about
02:10even with the letters ct in action.
02:13Now, select all of your text pieces and open up your Align panel by going to
02:18Window, and then Align, or hitting Command or Ctrl and then K.
02:25In the Align panel, make sure that the Align to stage checkbox is unchecked.
02:31Then, let's align bottom edge.
02:34To spread these out evenly, let's space evenly horizontally.
02:39With all of the pieces of text still selected, you can use your Arrow keys to
02:42move them up or down as needed, so they're positioned about the same spot that
02:46I've got on my screen, and when you're done, click off stage to deselect.
02:51Let's convert these each to a Button symbol.
02:53Right-click on "stop" and choose Convert to Symbol.
02:57Give the new symbol a name of "Stop," and be sure that button is selected in
03:01the Type drop-down.
03:03Do the same for "go," convert it to a symbol, give it a name of "go," and make
03:07sure that it's a button.
03:11We'll do the same for "start over," and "buy action figure."
03:24Open up your Library, and you'll see your 4 new buttons.
03:27To keep the library organized, let's add a folder by clicking on the Folder
03:31icon at the bottom, and double-clicking the name of untitled folder 1 to change it to "Buttons."
03:37Then, drag-and-drop all 4 of your buttons into the new folder, and that's all we have to do.
03:45If you go ahead and test your movie, you'll see that once the intro finishes
03:48playing, our buttons appear.
03:50When you mouse over them, the arrow turns into a hand indicating you can
03:53click on the button.
03:54Of course, nothing actually happens when you click as we have to write some
03:59ActionScript for that.
04:01But, our buttons are set up and ready for the script.
04:03Of course, the movie also does what it always does.
04:09After the playhead gets to the end of the timeline, it starts over at the
04:12beginning, and we see the intro scene again.
04:14It's about time to stop that, so the buttons and the animated car--that we
04:18haven't animated yet--will just stay on screen once they appear.
04:22Let's do this with a simple line of ActionScript.
04:25So close your test SWF, and return to Flash.
04:28First, make sure your Buttons layer is locked.
04:33So we know that the playhead starts at Frame 1, runs all the way to Frame 96,
04:37and then starts over again.
04:39We need to change it so that once it hits Frame 96, it jumps instead back to Frame 49.
04:43How we're going to do this is write ActionScript on Frame 96 that says, hey!
04:49Playhead, go to Frame 49.
04:50This script will run only when the playhead hits Frame 96 and every time it
04:55does, the line of ActionScript will run again, returning the playhead once again
04:59to Frame 49, and creating an infinite loop. So let's do it.
05:03On Frame 96 of the ActionScript layer, insert a blank keyframe.
05:10Then, with your new keyframe selected in the timeline, open up your ActionScript
05:14window by pressing F9 or going to the Window menu, and choosing Actions.
05:23The window appears and the line of code we need is this, gotoAndPlay (49).
05:30The command is just as it implies, hey playhead!
05:33Go to Frame 49, and resume playing.
05:36It's very important that you type this exactly as shown.
05:39There should be no extra spaces that A and the P need to be capitalized and the
05:43parentheses and the semicolon also need to appear.
05:46One clue is that the gotoAndPlay word will turn blue when you've typed it correctly.
05:52Hit F9 again to close your Actions window or click the Close button at the upper-right.
05:57Test your movie again, and this time, we should see the intro scene appear, but
06:02then the scene with the buttons and the speed limit sign stay on perpetually.
06:05Again, each time the Playhead hits the end of the movie at Frame 96, it's
06:09commanded by ActionScript to return to Frame 49 and keep on playing.
06:13If you wish to see this visually, under the View menu in your Preview window,
06:17choose Bandwidth Profiler.
06:21Here, you have a little graph that shows the length of your movie with frame
06:24numbers across the top.
06:26You can see the position of the playhead indicated by the moving gray arrow at the top.
06:30The playhead's position is also indicated under the state heading.
06:35To close the Bandwidth Profiler, go to View, and then choose Bandwidth Profiler again.
06:41Close your test SWF, and congratulations on your first practical application
06:45of Button symbols.
Collapse this transcript
Transforming symbols
00:00The transformations we looked at so far like affecting the SKU, resize and
00:05rotation can be applied to shapes and symbols.
00:08However, there are few other transformations that are worth knowing about that
00:12can only be applied to symbols, or a special kind of text called TLF text, which
00:17we'll talk about soon.
00:17I'll demonstrate these kinds of transformations by using the file
00:22called rocketToMars.fla.
00:24I'm going to start by clicking on the rocket.
00:27In the Property Inspector, see at the top of it that this is a Movie Clip symbol.
00:32Further down in the Property Inspector under the Color Effect heading, I'm going
00:36to drop down the Style dropdown and choose Alpha.
00:39Alpha refers to how opaque or transparent an object is.
00:44To fade the rocket out, slide the slider bar to the left.
00:46An Alpha of 0 means that the object is totally transparent, and an Alpha of 100
00:51means the object is totally opaque.
00:54You can also type-in an Alpha if you wish.
00:57The other options in the Style dropdown of Advanced, Tint and Brightness all
01:02offer you different intuitive ways to affect the coloring of an individual
01:06symbol instance on the stage.
01:08You can check these out on your own.
01:10So I'm going to set my Style drop-down back to None, so the rocket is back at
01:13its default look, and we can move on.
01:16Remember that all the color effects accessed from this dropdown can be applied
01:20to Movie Clips, Graphic symbols, Button symbols, and TLF text.
01:25The next type of transformation we're going to look at is one that many people
01:29get kind of excited about, it's rotating objects in a 3D manner.
01:34The thing to remember about 3D is that it can only be applied to Movie Clips and TLF text.
01:39It won't work on regular shapes, Button symbols, or Graphic symbols.
01:43I am going to make sure my rocket is still selected and in the Toolbar, choose
01:47the 3D Rotation tool.
01:49This is the fourth from the top and looks like a globe with an arrow around it.
01:53Notice that we have a series of control lines over our rocket.
01:57I'm going to approach one of the green lines, and you'll see a little Y
02:00appear next to the mouse.
02:02This tells us we're about to manipulate the 3D Y axis.
02:04I'm going to click-and-drag the line to see the effect.
02:10Similarly the red line affects the 3D X axis.
02:15The blue line affects the 3D Z axis.
02:19If you click-and-drag the orange line, you affect all three axes at once, which
02:24I think is a little harder to control and actually know what you're doing.
02:29If you like, you can pop-open your Transform panel by hitting Command+ or
02:32Ctrl+T on your keyboard, and then either sliding or typing-in a value for
02:36each one of the axes.
02:40This is also a great way to set everything back to 0 if you want to start over.
02:44I'm done with my rocket, so I'm going to try clicking on the "rocketToMars" text at the top.
02:51In the Property Inspector, notice that this is TLF text.
02:55Remember that you can rotate in 3D space only TLF text and movie clips.
03:00I'm going to use the green line to rotate the text, so it looks maybe a little
03:04bit like the text in the introduction to Star Wars or Superman.
03:10So there we have it, 3D rotation.
03:13We'll create a simple animation using this later on.
03:16For now, remember that the 3D effects can only be applied to movie clips and
03:20TLF text, nothing else.
03:22The other color effects like Alpha and Brightness can be applied to all three
03:26kinds of symbols and TLF text.
Collapse this transcript
5. Introducing Tweening
Defining motion tweens
00:00Much animation in Flash is built with what's called the Motion Tween.
00:04The term tween comes from the first days of animated cartoons.
00:08Imagine your favorite cartoon character in one pose with their arms up, then
00:12imagine the character in another pose with their arms down.
00:15The senior animators would draw those main frames, which you can think of like
00:19keyframes and then the junior animators would then draw in all the in between
00:24frames, so that when all the frames were played in quick succession, it looks
00:27like the character was moving.
00:29In Flash what you as the developer do is define the keyframes.
00:33Flash takes care of the inbetweening for you.
00:36To practice with motion tweening, open up a new blank FLA document.
00:40Select your Oval tool and set the fill to be the gradient red with no stroke.
00:45Draw a circle on the stage.
00:51It doesn't really matter if you're using Merge or Object Drawing mode because
00:55we're going to make this a symbol.
00:57To motion tween something on the stage, it has to be either a movie clip or a
01:00graphic symbol, or oddly enough, TLF text.
01:04Anyway, for us, let's convert our shape to a movie clip.
01:07Select your circle and press F8, or right-click and choose Convert to Symbol.
01:14Give your new symbol the name of "ball" and make sure that Movie Clip is selected
01:17in the Type dropdown.
01:20The workflow you need to use when making a Motion Tween is tell Flash where you
01:24wanted to start, apply the Motion Tween, and then tell Flash where you wanted to end.
01:28We'll start by telling Flash where we want the animation to start.
01:32We'll have our ball moved from left to right, so move your ball over to the
01:35left side of the stage.
01:36The next step is to apply the Motion Tween, but our movie is only one frame long.
01:41Animation, by definition, happens over time, so we need to extend our Timeline out.
01:46Click on your stage and look in the Property Inspector.
01:49We're at a Flash default of 24 frames per second.
01:53Let's go for a 1-second animation.
01:55So, let's extend our Timeline out to 24 frames by selecting frame 24 in the
02:00Layer and hitting F5 or right- clicking and choose Insert Frame.
02:07Now, we can apply the Motion Tween.
02:09Select any of the 24 frames, it doesn't matter which one, the tween will be
02:13applied across all of them.
02:14Then go to the Insert menu and choose Motion Tween or you could right-click on
02:20your frame and choose Create Motion Tween.
02:22You'll see that your frame span now turns blue, which is the indication that
02:26it's a Motion Tween span.
02:28Scrub your playhead across the frames and, of course, the ball doesn't do anything.
02:32We've told Flash where we wanted to start and apply the tween but we haven't
02:35told it where we want it to end.
02:38So, move your playhead to Frame 24.
02:42Then move your ball over to the right-hand side of the stage.
02:46You'll notice two things.
02:47First, a green line across the stage that indicates the path the ball will take
02:52and secondly a new little diamond on frame 24 in your timeline.
02:56Flash creates this ending keyframe for you automatically when you define the
03:00end state of the tween.
03:02Go ahead and test your movie to see the result.
03:05Indeed, your ball moves from left to right and plays over and over as the
03:08playhead runs out of frames on 24 and starts back over again at Frame 1. Close your SWF.
03:15Now, let's say, you want to change the position of the ball a little bit on frame 24.
03:20That's no problem;
03:21just make sure your playhead is on Frame 24 and then move the ball.
03:26The path of the Motion Tween is updated accordingly.
03:28Go ahead and test to see the effect.
03:30Now, I'd like to point something out.
03:34Close your SWF and in Flash right- click anywhere in the tween span on the
03:38Timeline and choose Remove Tween.
03:41The blue color goes away and the ball is just at the position defined in the
03:44keyframe on Frame 1.
03:46Remember, how when we made the tween we had said move the playhead to Frame 24
03:52before moving the ball to the right-hand side of the stage?
03:54Well, this is important and I'll show you why.
03:57Right-click in the middle of the tween span around frame 10 and Create Motion Tween.
04:02The tween is applied and you can tell because the Timeline turns blue.
04:06This time just leave your playhead where it is on frame 10 and move the ball to
04:10the right-hand side of the stage.
04:12See how the keyframe indicating the end of the tween now appears on Frame 10.
04:17Test your movie and see the result.
04:19The ball moves all right but it's faster since it does its motion in only 10 frames.
04:23It also hangs out on the right side of the screen for just a moment
04:27before starting over.
04:29And this makes sense, since the ending keyframe is at Frame 10 and the ball
04:33stays in the same position until Frame 24.
04:39So paying attention to where your playhead is when you define where you want the
04:43Motion Tween to end is pretty important.
04:46Even though all 24 frames are motion tweened, the ball only actually moves for 10.
04:51So remember, our workflow is to tell Flash where you wanted to start, apply the
04:55Motion Tween, and then tell it where you want it to end, but be careful where
04:58your playhead is when you define the end.
05:01Let's play a little bit here.
05:02Move your playhead to Frame 24.
05:05These frames are still Motion Tween frames, so there is no reason we can't make
05:09the ball move back to the left side of the screen.
05:12So, move the ball to the left side of the stage and notice that a new keyframe
05:16is added to frame 24.
05:18Test your movie and cool.
05:20The ball is bouncing back and forth.
05:21Now, close the preview.
05:23So we've been a little bit clever here by having the center keyfame act as an
05:28ending keyframe and a starting keyframe.
05:30You've probably noticed that the ball's bouncing was a little uneven.
05:34It's going to the right over the course of 10 frames but going back to the left over 14.
05:38If you'd like to fix this, select the middle keyframe.
05:42You'll notice that when you do the entire tween span is selected.
05:46To get just the keyframe, hold down the Command or Ctrl button on your
05:50keyboard and then click.
05:52This will allow you to grab just the keyframe and move it over to Frame 12.
05:56Now test again and the bouncing is more even.
05:59If you've made a tween too long, you can simply grab the end of the tween and shrink it.
06:04I'll try this now by making my tween only 12 frames long.
06:09The keyframe in the middle is still at the same relative spot and so let's test
06:12again and now we have a very fast bouncing ball.
06:16Now finally, what happens if you create a tween but later figure out that you
06:22wanted to appear just later or earlier in your movie?
06:25Well that's easy enough.
06:26Simply click and drag the tween span down the Timeline to your desired spot.
06:31I am going to have my tween start at Frame 24.
06:34Test again and we see 24 frames of nothing then 12 frames of a
06:39fast-moving bouncing ball.
06:41We're starting to get a little spastic with our bouncing ball here.
06:43So let's close our FLA.
06:45There's no need to save it unless you want to and open up our fastCar file.
06:50Let's apply a nice simple Motion Tween having the car drive from right to left.
06:54Unlock your moving car layer, move your playhead to Frame 48, and select the car on the stage.
07:01Remember that Motion Tweens can be applied to Movie Clips and Graphic symbols.
07:05Open up your Property Inspector and note that our car is conveniently already a Graphic symbol.
07:11Flash made it a Graphic symbol when we imported the car from Illustrator.
07:15So, let's do our workflow.
07:16Tell Flash where you want the tween to start, apply the Motion Tween and then
07:20tell it where you want it to end.
07:21The starting position is already defined.
07:23So, let's right-click anywhere on the moving car layer after Frame 49 and choose
07:28Create Motion Tween.
07:32Now that's left is to tell Flash where we want it to end.
07:35Move your playhead to Frame 96.
07:38Now, move the car way over to the left side of the stage off screen.
07:43You can hold the Shift key down while dragging to keep the car from floating up or down.
07:49Scrub your playhead to view the effect.
07:53If you don't like your ending position, click on the car on Frame 96 and adjust
07:57it or just undo and try again.
08:03When you're happy with the positioning, test the movie.
08:06The car should run smoothly from right to left and will start over again once
08:10it's driven off stage thanks to the Go to and Play command that we have on Frame 96.
08:13But guess what?
08:19See how the Speed Limit sign is appearing on top of the car when she drives by.
08:23Well, that's not good, but it's easy enough to fix.
08:26Back in your FLA simply drag the moving car layer up above the Speed Limit sign
08:31layer and test again.
08:32And the problem is solved.
08:44Close your SWF file and lock your moving car layer.
08:46Our Motion Tween is complete.
08:48So, now you've seen how to create Motion Tweens.
08:52Once again, the basic workflow to remember is tell Flash where you want it to
08:55start, apply the Motion Tween and then tell Flash where you want it to end.
Collapse this transcript
Motion tweening tips and tricks
00:00There are a number of modifications you can make to your Motion Tweens to make
00:04their effects more complex.
00:06To survey these, open the file called tweening .fla in the Exercise Files for this chapter.
00:11The file only has a single layer with a miniature instance of our familiar
00:15red car on the screen.
00:16Open the library and you'll see that we have two Graphic symbols;
00:20one of which of course is the lady in the car and the other is a rocket.
00:24The movie is 48 frames long, open the Property Inspector to find out our frames
00:29per second which is 24.
00:32So our movie is 2 seconds long.
00:34Let's start by creating a simple Motion Tween with the car on the screen.
00:37Remember, our Motion Tween workflow of telling Flash where you want it to start,
00:41applying the Motion Tween, and then telling it where you want it to end.
00:45Where the car is now is fine for the start position, so let's right-click
00:48anywhere in the frames and choose Create Motion Tween.
00:51Now, move your playhead to Frame 48 and move the car over to the right side of the screen.
00:57Test the movie once to see the effect.
00:59It's simple, so once you've seen it, go ahead and close the SWF.
01:03Move your playhead back to Frame 48 and select the car.
01:07Now, press Q on your keyboard to bring up the Free Transform handles on the car
01:11and scale the size of the car up.
01:13I'm also going to move it over so it doesn't end up offstage.
01:19Now test your movie.
01:23And as the car moves, it grows at the same time.
01:26So motion tweening can tween more than just position, you can also tween scale,
01:31rotation, and even Alpha which is the opacity.
01:35Let's close the SWF and select the car on Frame 48 again.
01:41Use your Arrow tool and then in the Property Inspector, under Color
01:44Effect, choose Alpha.
01:47Then, move the slider down to 0 or just type-in 0, so on Frame 48, the car
01:53is totally faded out.
01:55Test again to see the effect.
01:58Using this technique is very common for fading items in and out on stage.
02:02Now, let's reset so we can look at something else.
02:10Close your SWF and on your timeline, right-click somewhere in the tween span and
02:14choose Remove Tween.
02:15We're back to having the car just sitting stationary on the stage.
02:21Now, right-click and choose Create Motion Tween once again, then move the
02:25playhead over to Frame 48 and move the car over to the right.
02:34So we're back to having just a simple Motion Tween of having the car move from
02:38left to right across the stage.
02:40Now, our next trick has to do with Easing.
02:43Easing affects how fast or slow an object is moving at the start and end of its path.
02:48To change Easing, click once on the little line on the stage that indicates the
02:53path of the car, and notice how the Property Inspector changes to tell us
02:57information about the motion path itself.
03:00Under the Ease section, click-and-drag on top of the 0 to the right, to make the
03:05Ease 100, or you could just type it in.
03:10Test the movie to see the effect.
03:12The car starts off faster and slows down near the end of the Motion Tween,
03:16giving it a pretty realistic effect of coming to a smooth stop.
03:20Close the preview, and now change the Ease to -100.
03:26Test the movie, and you'll see the opposite effect applied.
03:29The car starts out slow, and speeds up as it drives.
03:35Close your test movie and change the Ease back to 0.
03:37Remember that if you don't see those options, just reselect the path on the stage.
03:44Now, in the Rotate area, let's type-in 2.
03:47We'll have our car rotate 2 times as it moves along its path.
03:52Notice the Direction dropdown has defaulted to CW for Clockwise.
03:57If you open it up, you'll see that CCW or Counterclockwise is also a choice.
04:03Test your movie to see this crazy effect.
04:05That's pretty wild.
04:09Close your movie and change your Rotation back to 0.
04:13Now, click on the car on the screen, and under the Window menu, choose Motion Presets.
04:20The Presets panel opens up and you can scroll through a whole bunch of different
04:23pre-built effects that you can apply to your Motion Tween.
04:27Click once on any one to see a preview.
04:29Now, I'll adjust my window so I can see the previews a little better.
04:36I'm going to choose Wave and click Apply.
04:47Flash asks you if you want to replace the current motion with what you've
04:50selected, and well, we can't stop now, so let's click Yes.
04:54You'll see the timeline and the motion path have been updated for you.
05:02Test your movie and when you're ready, close again.
05:08Close your SWF and undo by hitting Ctrl +Z until you're back to the spot where
05:13the car is just driving straight across the stage.
05:15Double-check you haven't backed up too far by clicking on the motion path, and
05:19looking in the Property Inspector.
05:21As long as you've got 0 for the Ease and no rotation, we're set to go.
05:26So now let's review a topic from the previous video which is how to change the
05:31ending position of a Motion Tween.
05:33Move your playhead to Frame 48, and click on the car.
05:36Move it up, so the net effect is that the car moves from the lower-left of the
05:39stage to the upper-right.
05:42Remember that you can change the starting and ending position of a Motion Tween at anytime.
05:46You just have to move your playhead to the frame in question and then move the graphic.
05:51Now, click on a blank spot on the stage to deselect, and for our next trick,
05:55approach the Motion Path with your mouse.
05:57You'll see a curved line appear next to your arrow when you get close to the path.
06:01Click-and-drag the path and you can see that you can actually curve it.
06:07Test your movie to see the effect, which probably looks just as silly as you
06:10anticipated since this is an unnatural movement for a car.
06:15There's one other handy-dandy technique to show you.
06:18What if instead of a levitating car, you want a flying rocket?
06:21Well, click on the car.
06:23It doesn't matter what frame the playhead is on, because Flash knows you're
06:26talking about the car during the entire Motion Tween.
06:29In the Property Inspector near the top, click the button that says Swap.
06:34Select the rocket, and click OK to swap the rocket out for the car.
06:40Scrub your playhead to see the effect.
06:45Now, a rocket could conceivably follow a path like this in real life, but it
06:49would be even more realistic if the nose of the rocket pointed in the
06:52direction of the movement.
06:54We can fix this by clicking once again on the blue motion path, and in the
06:58Property Inspector, find a little box that says Orient to path. Then, click it.
07:05Now, when you test your movie, you see that the rocket moves in a more natural way.
07:09Also, notice that the Motion Tween in the timeline is now a succession of keyframes.
07:17Flash has added-in a keyframe on each frame to account for the unique position,
07:22and rotation of the rocket on each frame.
07:25Imagine how much time that would take you to do frame-by-frame by hand.
07:29So that's the end of our Motion Tweening tips and tricks.
07:32I hope you'll find some of them useful in your future animation projects.
Collapse this transcript
Using motion tweens in 3D space
00:00If you're familiar with Motion Tweens and you're familiar with rotating items
00:04in Flash with the 3D Rotation Tool, you'll probably enjoy combining these two techniques.
00:09We have a spot in our fastCar.fla project where we can apply this.
00:13So open your fastCar project and make sure your playhead is at Frame 1.
00:17Let's have the text that says "The Really Fast New Sports Car" rotate in a 3D manner.
00:22To remind us what layer this is on I'll turn the visibility of the
00:26introText layer off and on.
00:28Now unlock the layer and click on the text on the stage.
00:35Open your Property Inspector and you'll see when clicking both pieces of text
00:39that they're both instances of classic text boxes.
00:45To create a Motion Tween you have to be working with a Movie Clip symbol or a
00:49Graphic symbol, so let's select both of the text boxes and then right-click on
00:53top of them to select Convert to Symbol.
00:55Let's give our new symbol the name of "introText" and under the Type dropdown make
01:03sure Movie Clip is selected.
01:08We know that we have to tell Flash how we want the Motion Tween to start, apply
01:12the tween and then tell it how we want it to end.
01:15Let's have the text start in a rotated position and move towards facing us
01:19head-on as time passes.
01:21So grab your 3D Rotation tool and click on the text if it's not already selected.
01:28Our control handles appear, so now approach the green line on the right side and
01:33click and drag it up and to the left a little bit, until the text looks about
01:37like what I've got here.
01:38We're set for our starting position, so now right-click in the Timeline on the
01:44introText layer and choose Create Motion Tween.
01:47Now move your playhead to Frame 12.
01:50The text should still be selected;
01:52you can now approach that's in the green line and rotate the text back so it looks flat.
01:57If you can't seem to get it exactly right, hit Command+ or Ctrl+T on your
02:01keyboard to bring up the Transform panel.
02:04Under the 3D Rotation section you can type in 0 for the y-axis rotation and
02:09the text will straighten out perfectly.
02:11Scrub your playhead to view the effect and make any changes that you like.
02:20When you're satisfied go ahead and test your movie.
02:24I think this is a much more interesting effect than what we had before;
02:27the text rotates in nicely and sets a kind of dynamic tone for the movie.
02:30So you can see that once you've mastered motion tweening and figured out
02:35rotating items in 3D space, combining the two really just uses the same process
02:40as setting up a Motion Tween.
02:42By now it probably sounds like a broken record, but the key is to remember the
02:46workflow for creating Motion Tweens.
02:48Tell Flash where you want it to start, apply the Motion Tween and tell it
02:51where you want it to end.
Collapse this transcript
Defining shape tweens
00:00Shape Tweens do exactly what the name implies.
00:03They allow you to tween from one shape into another.
00:06Unlike Motion Tweens, which require that you use a symbol like a Movie Clip or a
00:10Graphic symbol, Shape Tweens really stick to their name and that all you need is
00:14a shape just a blob of color on the stage.
00:17To practice with Shape Tweens, go ahead and start a blank FLA file in Flash.
00:23The workflow for Shape Tweens is a little different than that for Motion Tweens.
00:27For a Motion Tween, you first tell Flash where you want it to start, apply the
00:31Motion Tween, and then tell it where you want it to end.
00:34For a Shape Tween, you first tell Flash where you want it to start with a
00:37keyframe, then tell it where you want it to end, and then apply the Shape Tween last.
00:43So let's practice.
00:45Grab your Oval tool from the toolbar and set the Fill Color to be blue.
00:49Set the Stroke to be No Stroke and be sure you're using Merge Drawing mode.
00:55You can tell you're in Merge Drawing mode when this little icon here at the
00:58bottom is the lighter gray color as opposed to the darker gray color.
01:02So go ahead and draw a circle on your stage.
01:06We've told Flash where we want it to start, so now we have to tell Flash
01:09where we want it to end.
01:11Right-click on Frame 24 and choose Insert Keyframe.
01:15Change from your Oval tool to your Rectangle tool and draw a rectangle over the oval.
01:22Since we're in Merge Drawing mode and the rectangle is the same color as the
01:26oval, the two will fuse together and we end up with just the rectangle on Frame 24.
01:31So our last step is to apply the Shape Tween.
01:35To do this, get your Arrow tool and then right-click anywhere before Frame 24.
01:40Choose Create Shape Tween.
01:44The frames turn to a light green color with a little arrow pointing from Frame 1
01:48to 24 along the way.
01:50You can scrub your playhead to see the effect, and of course, test your movie to
01:54see how the circle morphs into a square.
01:57Close your SWF file.
02:00Now you can do more with Shape Tweens than just change the shape.
02:03You can change the content of either of the keyframes to further modify it, so
02:07I am going to move my playhead to Frame 24, select my rectangle, and then
02:11change the Fill to red.
02:12I am also going to grab my Free Transform tool from the toolbar and scale my
02:17rectangle up so it's bigger.
02:20Now when I test my movie, the shape is changing as well as the color and size.
02:27Close the SWF and now select your Arrow tool, move the big red rectangle over to
02:32the right side of the stage.
02:36If you scrub your playhead, you'll see the tween has updated accordingly.
02:40Our morphing circle is also moving to the right as it turns into a rectangle.
02:44So you can see that in one way shape tweening can do what Motion Tweens can
02:51do, at least when it comes to making an object look like it's moving across the stage.
02:57So let's practice our new workflow of tell Flash where you want the Shape Tween
03:00to start, tell it where you want it to end, and then apply the Shape Tween.
03:04Go ahead and close your practice FLA and open up our fastCar project.
03:11Scroll to the bottom of our layer stack in the Timeline and turn the visibility
03:15of the yellowSun, orangeSun, sunCircle and sunFace layers on and off to refresh
03:21your memory as to what's on each one of these layers.
03:25Let's use shape tweening to make the yellow sun rays shrink and grow so the sun
03:29has a little bit of motion to it, maybe almost like it's breathing.
03:33So go ahead and unlock the yellowSun layer and also zoom in a little bit so we
03:37can better see what we're doing.
03:39Select the sun with your Arrow tool and look in the Property Inspector;
03:43you'll see that it's a group.
03:45Shape Tweens don't work on groups;
03:47you have to have just plain shapes.
03:49So to ungroup our group, all we have to do is go to the Modify menu and choose Ungroup.
03:55Now look in the Property Inspector to confirm that indeed we've got a shape.
03:59So, so far we've told Flash where we want to start here on Frame 1.
04:02Let's tell Flash where we want the Shape Tween to end by right-clicking on Frame
04:0748 and choosing Insert Keyframe.
04:09Then select your sun and use the Free Transform tool to scale it down to make
04:15our yellow rays look like they're shrinking.
04:17You'll likely have to use your Arrow keys to move it back into a centered position.
04:26With that done, now apply the Shape Tween.
04:29Right-click on the yellowSun layer somewhere before Frame 48 and choose
04:33Create Shape Tween.
04:34Scrub your Timeline and you'll see that over the course of four seconds
04:37your sun's rays shrink.
04:40We now need to build out the sun's rays growing again.
04:43We already have the shrunken state of the yellowSun on Frame 48 and that's the
04:47starting point, so we just need the endpoint.
04:50The end state of the sun should look just like Keyframe 1, so let's copy what
04:55we have on Keyframe 1.
04:56Use your Arrow tool and click on frame 1 of the yellowSun layer, the sun shape
05:01is selected, so copy it.
05:03Now let's set up a Keyframe to paste into.
05:06Right-click on Frame 96 and choose Insert Blank Keyframe.
05:11Now, go to the Edit menu and choose Paste in Place.
05:15So we have a starting point and then ending point, all we have to do right now
05:18is right-click somewhere on the yellowSun layer between Frame 48 and 96 and
05:23choose Create Shape Tween.
05:25Scrub your Timeline, the sun should shrink and grow back to its original size
05:29over the course of 96 frames.
05:36This looks good while scrubbing the Timeline, so go ahead and test your movie.
05:39Now while the Shape Tween works, I think that the shrink happens so slowly over
05:49the course of that introductory four seconds, it's kind of hard to see.
05:53Same for when it starts to grow again.
05:54There is also one more problem.
05:57You'll remember that we have a line of ActionScript on the last frame of the
06:01Timeline telling the playhead to jump back to frame 49 every time it gets to
06:05the end of the movie.
06:07This means that we're looping through the part where the sun grows over and over;
06:11we never see the shrinking part again.
06:12It just hiccups back to where it starts growing.
06:15We'll fix this in the section about nesting timelines, so let's go ahead and
06:19close our SWF and zoom back out by choosing Fit in Window.
06:23For now, we've seen how you can use shape tweening to change a shape's shape,
06:28color, size, and even position.
06:30The thing to remember about shape tweening is that you must be working with the
06:34shape, no grouped objects and no symbols.
06:37The workflow, once again, is tell Flash where you want it to start, tell it
06:40where you want it to end, and then apply the Shape Tween.
Collapse this transcript
Nesting timelines
00:00By now we've seen how Movie Clip symbols, Graphic symbols, and Button symbols
00:04each have their own timeline.
00:06Those symbol timelines can hold animation which we can use to our advantage to
00:09create more detail in our animations.
00:12By nesting timelines, a nested animation can play at the same time but
00:17independently of the containing animation.
00:20Let's create two examples of nesting timelines by opening our fastCar FLA project.
00:25Unlock your stationaryCar layer and your movingCar layer and make sure all
00:29other layers are locked.
00:31Move your playhead to some frame in the first 48 so we're in the first half of the movie.
00:36Click once on the car on the stage.
00:41Open the Property Inspector and we're reminded that the car is an instance of
00:45the Graphic symbol called CarWithDriver, the one in the Library here.
00:50Now move your playhead to the last half of the movie somewhere between Frame 49 and the end.
00:54Click once on the moving car and in the Property Inspector we're reminded that
00:59this is also an instance of the same CarWithDriver Graphic symbol.
01:04So both instances of the car in the stage are pointing to the same blueprint of
01:08the Graphic symbol in the Library.
01:10If we change the blueprint in the Library, both of the instances on the stage
01:14will update accordingly.
01:16So test your movie now and note, if you haven't already, that of course the wheels don't turn.
01:21The car would be more fun if they did, so close out of the SWF and let's take
01:25advantage of nesting timelines to achieve that effect.
01:31With your car graphic still selected, double- click it to step into Edit in Place mode.
01:38Notice that the rest of the stage is kind of faded out and at the upper left,
01:42above the stage, it says Scene 1 and then CarWithDriver to indicate we've
01:46stepped into the Graphic symbols timeline.
01:48Right now the Graphic symbols timeline is only one frame long.
01:52The car graphic is really broken up into three parts.
01:54Open your Property Inspector and click on the body of the car.
01:58Note in the Property Inspector that this is a group of shapes.
02:02The front wheel and the back wheel are also their own distinct groups and each
02:06part is on its own layer.
02:10Let's make the front and back wheels their own symbols so we can animate
02:13them rotating around.
02:15To create animation we're going to need our timeline to be longer than one frame.
02:19Let's extend our timeline out to 12 frames, so one second long since our movie
02:24has a frame rate of 12 frames per second.
02:27So click Frame 12 on the CarWithDriver layer and to select the other layers
02:31too, hold down the Shift key on your keyboard, then select Frame 12 on the two
02:35Wheel layers as well.
02:37Then hit F5 on your keyboard or right-click and choose Insert Frame.
02:42We don't need the body to animate, so let's just lock that layer.
02:45Let's animate the front wheel first.
02:48To create a Motion Tween, we need a symbol.
02:50The front wheel is currently just a group of shapes as you remember, so select
02:54the front wheel and convert it to a symbol.
02:56Give the new symbol the name of "frontWheel," and for the Type, make it a Graphic symbol.
03:01It could just as well be a Movie Clip, but since it's going to be appearing
03:05nested in the timeline of the CarWithDriver graphic symbol, we'll just keep the type the same.
03:10Now do the same for the back wheel.
03:12Convert it to a symbol, give it the name of "backWheel," and make sure that it's a Graphic symbol.
03:18Now we need to create the motion tweens to make the wheels starting with the front wheel.
03:23Remember, once again our workflow of tell Flash where you want the tween to
03:27start, apply the tween, and then tell it where you want it to end.
03:30We already have our initial position defined in Frame 1.
03:33So let's right-click anywhere in the frames on the Wheel1 layer and choose
03:38Create Motion Tween.
03:41Now let's tell Flash where you want it to end by moving our playhead to Frame 12.
03:46We don't need to change the position of the wheel;
03:48just have it rotate.
03:50You may remember there's a handy place where Flash can do this for you.
03:53It's in the properties for the tween frames themselves.
03:56To access this, click on Frame 12 in the Wheel1 layer and open up the
04:00Property Inspector.
04:04Under the Rotation heading, type in 1 to have the wheel rotate one time over the
04:09course of the 12 frames.
04:11Also change the Direction dropdown to CCW for counterclockwise.
04:15You'll notice that Flash has now inserted a new keyframe for us on Frame 12.
04:20Scrub your timeline to see the effect and the wheel definitely looks like it's rotating.
04:28We need to do the same for the back wheel, so go ahead and lock your Wheel1 layer.
04:32Right-click anywhere within our 12 frames of the Wheel2 layer and choose
04:37Create Motion Tween.
04:39Click on Frame 12 to move your playhead and have the properties for the tween
04:43show up in the Property Inspector.
04:45Type in 1 for the number of times to rotate and make sure CCW is in
04:50the Direction dropdown.
04:51Scrub your playhead if you wish to see the effect and then click Scene 1 at the
04:55top of the screen to return to the Main Timeline.
04:59So what we're expecting to see is the timelines of the nested wheel Graphic
05:03symbols playing independently of the containing CarWithDriver Graphic symbol.
05:08Let's test our movie by pressing Ctrl+ Enter and indeed the wheels are clearly
05:13rotating during the intro phase and they look good, I think.
05:18The wheels are almost a blur of motion in the scene where the car is
05:21moving across the screen.
05:22There's a lot of motion here, but I think that's okay.
05:25I think she's supposed to be speeding.
05:27So we're done creating our nested tweens.
05:29Let's go ahead and lock the unlocked layers.
05:36Now on to our next challenge.
05:38Scroll down in your layers to the four layers that make up the sun and unlock them;
05:42yellowSun, orangeSun, sunCircle, and sunFace.
05:48Remember our Shape tween that we applied to the sun, I am going to scrub
05:52the Timeline to see it.
05:54The sun shrinks from Frames 1 to 48 and then returns to its original size from 49 to 96.
06:01Go ahead and test your movie.
06:03I think that the shrink happens so slowly over the course of that introductory
06:07four seconds it's kind of hard to see.
06:10Same for when it starts to grow, but there's also another problem.
06:13You remember that we have a line of ActionScript on the last frame of the
06:15Timeline telling the playhead to jump back to Frame 49 every time it gets to the end.
06:21So this means we're looping through the part where the sun grows over and over.
06:24We never see that shrinking part again.
06:27Here's how we can fix this with nested timelines.
06:30First, let's just shorten our Shape tween so that it only takes half the time to
06:34play through, so 48 frames instead of 96.
06:36Then we'll move all the parts that make up the sun, all four layers, into their
06:41own Movie Clip symbol.
06:43That way the shrinking and growing of the sun will play independently from the
06:46main timeline because it will be nested in the movie clip timeline, so let's do it.
06:51To move the keyframes of the Shape tween, just drag and drop.
06:54So my middle keyframe on Frame 48, I'll move to 24.
07:00Then I'll move the last keyframe to Frame 48. And voila!
07:07Our shape tween time is cut in half.
07:10We don't want frames 49 to 96 for the sun layers.
07:14So let's just get rid of all those extra frames at once.
07:17Hold down Shift and click on Frame 49 on the sunFace layer.
07:21Keep holding down Shift so we can select multiple frames and select Frame 49 on
07:25the yellowSun layer.
07:27Keep holding down Shift and select Frame 96 on the yellowSun layer.
07:31Now right-click and choose Remove Frames.
07:37Scrub your playhead from Frames 1 to 48 and these frames on these four layers
07:41are what we're going to move into a Movie Clip symbol. So let's do it.
07:49Hold down Shift and click on Frame 1 on the sunFace layer.
07:53Keep holding down Shift and select Frame 1 on the yellowSun layer.
07:57Keep holding down Shift and select Frame 48 on the yellowSun layer.
08:02Now right-click and choose Copy Frames.
08:05Our frames are placed in our computer's memory.
08:07We need a new Movie Clip symbol to paste that stuff into, so let's create a
08:10blank one and then paste in.
08:13Go to the Insert menu and choose New Symbol.
08:17In the Create New Symbol box, let's type in a name of just "sun."
08:21Under the Type dropdown, let's make this a Movie Clip.
08:24It could be a graphic symbol just as well, but let's just select Movie Clip.
08:29Click OK and the screen changes and you're presented with a blank timeline of
08:34your new sun Movie Clip symbol.
08:36To paste in all the stuff we just cut off the Main Timeline, right-click on
08:40Frame 1 of Layer 1 and choose Paste Frames.
08:43Now our sun layers magically appear in all their glory.
08:46So click Scene 1 to return to the Main Timeline and open your Library.
08:50See your new sun Movie Clip symbol? Awesome!
08:53Let's use it.
08:54So now delete these four sun layers and then let's create a new layer above the
09:01bgImage layer and call it sun.
09:08Select Frame 1 of the sun layer and drag the sun to the stage from the Library
09:12and it now appears for all 96 frames.
09:15Test your movie to see the effect.
09:17Watch and you'll see how the sun's timeline runs independently of what's going
09:21on in the Main Timeline.
09:24So let's close the SWF and review.
09:27The sun's nested timeline is 48 frames for one grow and shrink cycle.
09:32Then its playhead runs out of frames and starts over.
09:34Thus, it grows and shrinks once during the 48 frames of the intro scene on the Main Timeline.
09:40Then it shrinks and grows again during the last half of the Main Timeline.
09:44Because the Main Timeline and the sun clip both work in increments of 48
09:48frames, they both read 96 total frames played at the same time and then start
09:53over at the same time.
09:54So you can see that nesting timelines, especially when those nested timelines
09:58have animation on them, can be a great technique for adding extra motion and an
10:02extra element of reality to your projects.
10:05You could use this technique to have a butterfly fly from left to right on the
10:08main timeline and have the wings move up and down in the nested timeline, or you
10:13can have a character move across the screen on the main timeline and use the
10:17nested timeline to make him flap his arms, or have a train with steam coming out
10:21at the top, or a whale who wiggles his tail, or a cyclist who peddles her legs.
10:26The possibilities are endless.
Collapse this transcript
Using shape hints
00:00When Shape Tweening, sometimes you need to provide Flash with some hints about
00:04how you want your shape to look as it morphs.
00:07Shape Hinting is what you can use to help better control your Shape Tweens.
00:11First let's set up an ugly shape tween.
00:13So open a new blank document in Flash and right away grab your Text tool.
00:17Choose an easy to read font like Arial at about 72 points and whatever color you'd like.
00:27Now type the number 1 on the stage.
00:30Now right-click on Frame 24 and choose Insert Keyframe.
00:34A new keyframe is inserted, with the information from frame 1 copied into it.
00:39Use your Text tool to change the 1 into a lowercase a. Now grab your arrow from
00:45the Toolbox and select your a. Go to the Modify menu and choose Break Apart,
00:51once and then do it again.
00:56Our letter is now a shape, you can tell by looking in the Property Inspector.
01:01Click over to Frame 1 and let's do the same for the number 1.
01:04Modify Break Apart and then Modify Break Apart.
01:08We have a starting and ending state for our Shape Tween, so all that's left is
01:11to actually apply the Shape Tween.
01:14So go ahead and right-click anywhere in your Timeline and choose Create Shape Tween.
01:21Scrub your playhead or test your movie and check out the results.
01:24While the one does indeed morph into an a, the tween may or may not look the way you want it.
01:29It's kind of all jumbled up in the middle.
01:31So Shape Tween allows you to match up the edge of an object at the start, to the
01:36edge of an object at the end of the tween.
01:38To try this, move your playhead to Frame 1;
01:41then go to the Modify menu, choose Shape and then Add Shape Hints.
01:46A small red circle appears with an a in it, move this to the upper left of your number 1.
01:54Add another Shape Hint by going to the Modify menu, choosing Shape and then Add Shape Hint.
02:01Move your second shape hint to the left edge of the number 1 as shown.
02:06Just a note, it can be easy to try to click and drag a shape hint and they
02:10all suddenly disappear.
02:12If this happens to you, go ahead and just add another shape hint and they
02:15should all reappear.
02:17You can move your extra shape hint just below another one, or you can
02:20right-click any shape hints, that are extra and choose Remove Hint.
02:26Now move your playhead to Frame 24 and you probably only see one shape hint
02:30marked b. That's okay, move it right out of the way and you'll see that a was
02:35just hidden underneath it.
02:36Move you're a and b shape hints into the positions shown, on the left side of the letter.
02:41By positioning the shape hints you're telling Flash, what edge to match up, with
02:45what edge during tweening.
02:47The Shape Hints will individually turn green when Flash recognizes a match
02:51between, for example, the b shape hint on frame 1 and the b shape hint on frame 24.
02:57With your shape hints now in place, scrub your Timeline or test your movie and
03:01the tween looks a lot different, doesn't it?
03:03And in my opinion it's a more attractive tween.
03:05Use Shape Hints whenever you want to help Flash define how a Shape tween should morph.
03:12While you can have a very high number of shape hints on the stage, remember that
03:16the shape hints should only go on the edges of visual objects.
Collapse this transcript
Animating with graphic symbols vs. movie clips
00:00We learned earlier in the course that Graphic symbols and Movie Clip symbols
00:04both have their own internal timelines.
00:06Because they both have their own internal timelines, up to this point the main
00:10reason to make something a Movie Clip instead of a Graphic symbol is if you want
00:14to control it with ActionScript.
00:16Movie Clips can be controlled via ActionScript and Graphic symbols can't.
00:20Other than that at first glance there doesn't seem to be much reason to pick
00:23one over the other.
00:25Well, actually there are some kind of big differences in how graphics versus
00:29movie clips behave in terms of animation.
00:31So let's take a look at that so you can choose with confidence which one is
00:35going to serve you best in different situations.
00:37In your Exercise Files for this chapter, you can open up butterflyGraphicMC.fla
00:43and follow along if you wish, or you can just watch but not perform the steps.
00:47So we've got two layers out our Timeline here.
00:49The labels layer is simply some text to label which of the butterflies is a
00:53Movie Clip symbol and which is a graphic.
00:57When I click on each of the butterflies, it shows in the Property Inspector that
01:01the left one is an instance of butterflyMovieClip and the right,
01:05butterflyGraphic Graphic symbol.
01:08Open up the Library and you'll see those two symbols there.
01:13Here's the Movie Clip and here's the Graphic symbol.
01:16They look exactly alike and they do the exact same thing.
01:19The only difference is that one is a Movie Clip and one is a Graphic symbol.
01:23If I double-click on the movie clip butterfly to look at its timeline, we see
01:27it's got three layers, one that's just a static body and then the leftWing and
01:32rightWing that our movie clip is being motion-tweened over the course of 24
01:36frames to make it look like they're flapping.
01:38You probably notice the leftWing and rightWing symbols in the Library that are
01:42being used to make the flapping.
01:45The internal timeline of the graphic butterfly is exactly the same as this, so
01:50let's return to the Main Timeline.
01:53Notice how the Main Timeline is only one frame long.
01:56When I test my movie, you'll see that the movie clip butterfly is moving but the
02:00Graphic symbol one isn't.
02:02That's one main difference right there.
02:04The timeline of a movie clip plays independently from the Main Timeline.
02:08It doesn't care if the Main Timeline has one frame or 100;
02:11it just plays on its own.
02:13However as you can see, the graphic symbol is affected by this and basically it
02:17just shows the butterfly stuck on its Frame 1.
02:20So let's go back to the FLA and insert frames to extend the timeline out to
02:2424 frames since, if you remember, the timelines of the butterflies are both 24 frames long.
02:30Now let's test again and this time you can see the Graphic symbol animating, too,
02:35because the Main Timeline has enough frames to show the animation. All right!
02:39So that's good to know, right?
02:41Well, I want to stress just how important it can be for the number of frames on
02:45your Main Timeline to match or exceed the number of frames in a Graphic symbol.
02:50Let's try removing some of the frames on the Main Timeline so we only have 16 and test again.
02:59The movie clip doesn't even flinch;
03:00it just plays on and looks fine.
03:02But as you can see, we see a jump in the Graphic symbol butterfly because while
03:06it's trying to play all 24 of its frames, the Main Timeline only has 16.
03:11Graphic symbols are kind of tied to the parent timeline in that way and it's a
03:15common thing for someone to animate in a Graphic symbol but not have enough
03:19frames on the Main Timeline and then wonder, gosh!
03:22What's going on here? What's wrong with my animation?
03:24Is something wrong with the Flash Player?
03:26Well, no, it's not that at all.
03:28If this happens to you, you just have to remember to count up the frames in your
03:32Graphic symbol and then extend the Main Timeline out to the same number of
03:36frames or more, like this.
03:38This time I'll extend it out to 48 frames, and when we test again, it'll work just fine.
03:48So moving on, here's another difference in behavior between movie clips
03:51and Graphic symbols.
03:53If you scrub your timeline in your FLA, you'll notice that you can preview the
03:57motion of the Graphic symbol, but you can't see it for the movie clip.
04:01If you're doing a very synced animation where you want a lot of frame by
04:04frame control, the Graphic symbol might be what you want to use for ease of development.
04:10Graphic symbols also offer you some additional methods for control.
04:14Click on the movie clip and you'll see the options available to you in
04:16the Property Inspector.
04:18We've seen these things before.
04:19You could do things like change the position and the size, maybe swap out what
04:23symbol you're using here, but that's kind of about it.
04:26Now click on the Graphic symbol and notice this whole loop area in the
04:30Property Inspector.
04:31Starting with what we've got, our Graphic symbol is looping through its timeline
04:35starting on Frame 1.
04:38And if we test the movie, this is what we've seen before.
04:41So let's now go ahead and change our first frame to Frame 12 and test the movie
04:46again, and here the butterfly loops but it starts from its Frame 12.
04:50So they look kind of all set here and that's a neat effect.
04:53Back to our controls, let's change this to Single Frame and then change it to 7.
05:01When we test, the Graphic symbol is just going to hold on Frame 7.
05:07You can further play with the settings here to see how it affects the Graphic symbol.
05:12Imagine you are making a butterfly forest and you had maybe 24 different
05:15instances of the butterfly on the stage.
05:17These controls could allow you to really easily create perceived randomness and
05:21offsets with the flapping of all the different sets of wings.
05:25For now, let's set our Graphic symbol butterfly back to Loop starting on Frame 1.
05:32So we've seen how the behavior of Graphic symbols really depends on what's going
05:36on in the Main Timeline and the settings you've chosen for it.
05:40The movie clip just kind of chugs along unaffected.
05:43Now I am going to make a new layer in our movie and call it "actions," and on
05:46Frame 12, I am going to insert a blank keyframe.
05:52Now I am going to write one single line of ActionScript code by going to Window,
05:56Actions, and typing in "stop."
06:01This command tells the playhead to stop when it reaches Frame 12.
06:05When I test, you'll notice that the Graphic symbol stops when the playhead gets
06:09to Frame 12 and here I'll play it again for you since it happened so fast.
06:14So yet again, we see how the Graphic symbol is tied to what the parent timeline is doing.
06:18The Movie Clip symbols timeline could care less and it's just
06:21playing independently.
06:22So you can see there are advantages and disadvantages to both movie clips and
06:26Graphic symbols depending on what you want to do.
06:28Of course, remember the huge difference between the two that only Movie Clip
06:33symbols can have an instance name attached to them so ActionScript can affect it later.
06:38If you're building a game and you want to count how many butterflies you've
06:40caught or maybe you want to make one of the butterflies clickable, they have
06:44to be movie clips.
Collapse this transcript
6. Using Effects and Masks
Understanding filters
00:00Filters are special effects you can apply to movie clip instances or TLF text.
00:05They can be a really fast and fun way to beef up some of your imagery.
00:09In your fastCar FLA file, let's add a filter to the opening text that says, It's
00:14The Really Fast New Sports Car.
00:17So let's move our playhead to Frame 12 so we can see the text straight on and
00:21lock all your layers except for the introText layer.
00:26Click once on the introText movie clip on the stage and now over in the Property
00:30Inspector, open up the Filters dropdown.
00:34There's an icon that looks like a little piece of paper at the bottom left.
00:38Click on that once to see the filters you can choose from.
00:41Let's choose Drop Shadow.
00:43You'll see immediately that a drop shadow has been applied to the text of the movie clip.
00:47Changing the Blur X and Blur Y setting affects how diffused the drop shadow is.
00:52Notice that you can also click on the little picture of the chain to unlink the
00:56Blur X and Blur Y so you can change them horizontally or vertically without
01:00affecting the other dimension.
01:02Changing the Angle property affects which side of the text the shadow appears on.
01:06Notice that you can make it move from left to right.
01:09And changing the Distance affects how far away from the text the drop shadow lands.
01:14I can even change the color of the drop shadow to something else.
01:18You can play around with all of the other different options to see what they do,
01:21but for now I am going to click on the name of the filter, Drop Shadow, at the
01:25top, and then at the bottom of the Property Inspector, click the little arrow to
01:29reset the filter back to the defaults.
01:31I am going to link up my Blur X and Blur Y again, so if I change one, the
01:36other moves proportionally and change the Blur to 6 and the Distance of the Drop Shadow to 7.
01:42If you scrub your red playhead across the timeline, you'll see your drop shadow
01:46applied nicely all the way across the tween.
01:50So let's say you really like this filter and you want to apply it somewhere else.
01:54You can save the settings that you've chosen for this filter as a preset to use
01:58on another object somewhere else.
02:00Click on your introText movie clip on the stage again so the Filters panel shows
02:05in the Property Inspector.
02:06Then click the word Drop Shadow.
02:08Now click the icon that looks like multiple pieces of paper and choose Save As.
02:13Let's save our preset as myDropshadow.
02:17Let's apply our drop shadow to the sun, so let's unlock the sun layer and click
02:21on the sun movie clip instance on the stage.
02:24Now you can open up the presets in the Property Inspector and choose the
02:27myDropshadow you just created to apply it to the sun. And there it is.
02:33A movie clip can have more than one filter applied to it.
02:36So since this is the sun, let's also give him a Glow Filter.
02:40Click the Add Filter button, the one that looks like a single piece of
02:43paper, and choose Glow.
02:45Let's change the default color from red to an orange, how about FF3300, and
02:52change the Blur to 15.
02:55So the sun is glowing and looks good, but I am actually not sure I want the sun
02:59to have a glow and a drop shadow.
03:01So let's turn the visibility of the Drop Shadow off to test this out.
03:05I'll click on the Drop Shadow title and at the bottom of the Property Inspector,
03:09click the Enable or Disable Filter button that looks like an eye.
03:13The drop shadow is turned off.
03:15If you want to turn it on again, you have to click Drop Shadow again and then
03:19click the eye again.
03:21So after looking at this, I've decided I do want the sun to have just the Glow
03:24Filter and not the Drop Shadow.
03:26So I am going to click on the Drop Shadow heading one more time, then click the
03:29Delete Filter button.
03:32You've probably also noticed the Clipboard icon at the bottom of the
03:35Property Inspector.
03:37This is useful for copying and pasting a filter between items as opposed to
03:41using a preset, so let's try it.
03:43If you click on the Glow Filter title and under the Clipboard, notice the
03:47options of Copy Selected, Copy All, and Paste.
03:51Choose Copy Selected and now your Glow Filter presets are copied to your
03:54computer's memory ready to paste onto another object.
03:58Click on your introText movie clip and in the Property inspector, we'll go to
04:01the Clipboard again and choose Paste. Voila!
04:05Our glow is applied to the intro text.
04:07So copying and pasting filters between items is pretty straightforward.
04:11Now that we've seen it, the Glow Filter I think is too much on the intro text.
04:15So let's click on the Glow Filter and then click on the trashcan to delete it
04:19leaving our intro text with only the Drop Shadow.
04:22Remember before that we've had filters can only be applied to Movie Clip
04:25symbols and TLF text.
04:27To prove it, let's try adding a filter onto the car.
04:30Lock all your layers and now unlock the stationaryCar layer in the Timeline.
04:34Then select the instance of the car on the stage.
04:37And indeed we can't add any filters to the car.
04:40The Filters area in the Property Inspector just doesn't appear.
04:44That's because the car is a Graphic symbol.
04:46You can tell by looking in the Property Inspector at the top, it shows that it's
04:50an instance of the Graphic symbol.
04:52So filters are an easy way to add some visual depth to your imagery.
04:56All you have to do is click on the item and open the Filters section in
04:59the Property Inspector.
05:01The thing to remember is that filters can only be applied to movie clip
05:04instances or TLF text.
05:07We're done with adding all our filters, so as the last step, let's lock all
05:10of our layers.
Collapse this transcript
Understanding masks
00:00Masking in Flash is a technique where you can make only certain parts of
00:04the screen visible.
00:05You achieve the effect using layers and is not unlike using masks in other
00:09programs like Adobe Photoshop.
00:11To practice with masks, open the file called mask.fla in the Exercise Files for this chapter.
00:18The file has three layers in it.
00:19If you turn the visibility of the background layer on and off, you'll see this
00:23is where the image of the flower is.
00:26This is an instance of the blue- flowers.jpg in the Library. All right!
00:31Let's go ahead and lock this layer and now let's turn the visibility of the
00:35text layer off and on.
00:37This is where the word flutterby is and you can see it's an instance of the
00:41movie clip called "text" in the Library. All right!
00:45Let's lock the text layer and this pretty much leaves us the butterfly.
00:49Open the library and you'll see the butterfly movie clip.
00:52The butterfly doesn't just sit there.
00:54Go ahead and test the movie by pressing Command+ or Ctrl+Enter and you'll
00:58see the butterfly's wings move.
01:00Close the SWF and back in Flash, let's double-click on the butterfly on the
01:04stage to get into Edit in Place mode to see how it's made.
01:09You can see it's got three layers.
01:11One that's the body, one that's the rightWing and one that's the leftWing.
01:16The rightWing and the leftWing are both movie clips that have been motion tweened.
01:19Look in the Library and you'll see those two movie clips.
01:22So, now that we know what our movies made up of, we're ready to create a mask.
01:28Let's click on Scene 1 at the upper left of the screen to return to the Main
01:31Timeline and lock the butterfly layer.
01:34Let's make our mask, so that only the butterfly, the text, and part of the
01:38flower underneath show.
01:40The first step is to create a new layer above all the other layers and rename it mask.
01:46Now, we have to draw a shape to be the mask.
01:49What this shape covers will be what appears on the screen and everything
01:52else will be masked out.
01:54So grab your Rectangle tool and in the Property Inspector let's set our Stroke
01:58to be null and choose a color for the Fill.
02:01I recommend a light color that will show up easily like light green.
02:05I'd also recommend setting the Alpha of your fill to 50%, so it's a little bit transparent.
02:12This will make it easy to see what's behind the mask as you will soon see.
02:16Go ahead and draw a rectangle that covers your butterfly, the text, and a
02:20little bit of the flower.
02:21You can see through the green because the Alpha is 50%.
02:24The next step is to change the layer from a regular layer to a mask layer.
02:29To do this, double-click on the icon next to the layer name that looks like a piece of paper.
02:34This opens up the Layer Properties dialog box.
02:37Choose the Mask radio button to change the layer from a Normal layer to a
02:41Mask layer and click OK.
02:44You'll notice that the icon next to the layer name has now changed to indicate
02:48this is a mask layer.
02:50However, nothing else on the screen looks like it's really changed.
02:53And that's because we have yet to tell Flash what layers we want to be
02:56affected by the mask.
02:58So, on the butterfly layer, double- click on the icon next to the layer name,
03:02open up the Layer Properties box, and change it from a Normal layer to a
03:06Masked layer and click OK.
03:09You'll notice that the layer's icon has changed to indicate it's masked.
03:13It's also indented a bit underneath the mask layer.
03:16To quickly change the other two layers to mask layers, we could go through
03:19the process we just did again or simply click and drag the layer name to the
03:23right until you see a dark black line appear underneath it, then drop it
03:27under the mask layer.
03:28Now, the text and background layers are masked layers.
03:32We've set up our mask correctly but it still doesn't look like any thing's
03:35changed on the screen.
03:37However, if you test your movie, you'll see in the resulting SWF that your mask
03:40has been successfully applied.
03:42We can only see the portion of the stage covered by the mask.
03:45So, here's the secret to be able to see the effect of the mask in Flash.
03:49Go ahead and close your test movie and back in Flash all you have to do is
03:53lock all of the layers. Presto!
03:55Our mask effect appears and notice what happens when you unlock the mask layer.
04:00You can still see the shape of the green mask but the effects doesn't appear.
04:05Now unlock and lock each of the three layers one at a time.
04:09You can see that while you can still kind of see what the mask effect is going
04:12to be, because the green square is visible, it's not the full effect.
04:16The point is that when you're working with masks, if you aren't seeing your
04:19full-on mask effect and want to, be sure all the affected layers are locked and visible.
04:25So, this is all very nice but let's move on and look at one practical
04:28application of masks you might like.
04:31That's to make the mask animated in order to reveal different parts of
04:34the screen over time.
04:36You might have seen this called a Wipe Effect maybe in places like PowerPoint
04:40presentations where words on the screen reveal from left to right or in photo
04:44galleries where an entire picture is revealed from one site to another.
04:48Let's do this to our movie.
04:49We'll have the entire flower background appear all the time and animate the
04:53mask, so the butterfly and the word flutterby are revealed, then disappear over time.
04:59Let's have our animated mask move over the course of 4 seconds.
05:03If you click somewhere off the stage and open the Property Inspector, we see
05:07that our frame rate is 24 frames per second.
05:09So, to have 4 seconds, we need to extend our timeline out to 96 frames since 24
05:14multiplied by 4 is 96.
05:16So, I am going to scroll over and select all of my layers and Insert Frame to
05:23extend the timeline out to 96 frames.
05:27We want to make our mask animate from left to right.
05:30So let's build a Motion Tween on the mask layer.
05:33Note that we could use a Shape Tween just as well but for this example we'll
05:36use a Motion Tween.
05:38Remember, for a Motion Tween we have to have a symbol.
05:40So, unlock the mask layer, select your green rectangle and convert it to a symbol.
05:46Type in the name of mask for your symbol and let's make it a movie clip.
05:49So, be sure Movie Clip is selected in the Type dropdown.
05:55Our workflow to create a Motion Tween is tell Flash where you want it to start,
05:59apply the tween, and then tell it where you want it to end.
06:02So, move your red playhead on the timeline to frame 1 and now move the green
06:06rectangle over to the left of the butterfly and the text.
06:09So, that's where it starts.
06:12Now, right-click anywhere on the mask layer in the timeline and choose
06:15Create Motion Tween.
06:18Now, to tell Flash where you want the tween to end, move your red playhead over to Frame 96.
06:25Now, move the green rectangle over to the right-hand side of the butterfly.
06:30Go ahead and scrub your playhead to preview the tween acting as the mask.
06:33First, I am going to lock my mask layer, so I can see what it looks like.
06:38This looks pretty good except that we'd said we want the flower background to
06:42appear all the time.
06:43This is easy enough to change.
06:45All we have to do is make it a Normal layer again.
06:47So, in the Timeline, click the word background and drag the layer down into
06:51the left to unindented.
06:53You should see that black underline appear to guide you as to where you can drop it.
06:57When you're done, the layer should not be indented under the mask title and
07:01the little icon should be the piece of paper again indicating this is a Normal layer.
07:06If the dragging doesn't work well for you, remember you can just double-click on
07:09the Layer icon and then select the Normal radio button.
07:12Now, let's go ahead and test our movie by pressing Ctrl+Enter and our desired
07:17effect has been achieved.
07:19The butterfly and the text are revealed and then disappear as the animated mask
07:23moves across the screen.
07:24You can see that masks can be a very effective way to create some neat visual effects.
07:29Remember that the bare minimum that you need to create masks are a mask layer
07:34and at least one masked layer that's indented underneath it.
07:39The mask layer can be static or have a Motion Tween or even a Shape Tween in it
07:43for a more dynamic fill.
Collapse this transcript
7. Working with Text
Understanding classic text
00:00There are two main types of text you can choose between in Flash;
00:03Classic text and TLF text.
00:06Which one you pick affects the text formatting options available to you and the
00:09final file size of your SWF.
00:11So let's peek at the different types of text, starting with Classic text.
00:15Let's open our fastCar.fla from before and add some text that will appear in the
00:20last half of the movie as the car goes across the stage.
00:24Add a new layer, above the movingCar layer and rename it "text."
00:28Then go ahead and make sure all your other layers are locked.
00:31Now on Frame 49, let's right-click and choose Insert Blank Keyframe, so our
00:36first text will appear as the car starts moving.
00:38Now over on your toolbar click on the Text tool which looks like a capital T. As
00:44soon as you click it, you should see your Properties panel open up with all the
00:47different options you can choose from for your text.
00:50The first thing to notice is this first drop-down at the top, which gives you a
00:53choice between TLF Text and Classic Text, let's choose Classic.
00:58Under the next drop-down, you get a choice between Static, Dynamic and Input Text;
01:03we're going to choose Static Text.
01:05All we want our text to do is just appear on the stage, so this is
01:08the appropriate choice.
01:10You would choose Input Text, if you wanted to create maybe a text box that
01:14collects information from the user, for instance a place for a person to type in
01:18their name or the phone number.
01:20Dynamic text is text you would want to be able to change, based on what's
01:24going on in your movie.
01:25For instance, maybe you want to output the result of a calculation that you've
01:30done in ActionScripts and then display it to the user.
01:33For now we'll just stick with Static Text.
01:35I'm going to choose to have my text be Arial, Bold, 18 points (18 pt) and choose
01:40for the color yellow.
01:41I'm also going to make sure that my Alpha is 100% on the color.
01:45I'm also going to have my text be left-aligned.
01:50Now I'm going to click once on the stage and type the phrase, "She got a
01:54brand new sports car."
01:56You can move your box around if you want to adjust the position, by selecting
01:59your Arrow tool again and moving it around.
02:03That's pretty straightforward.
02:04So to play a little more grab your Text tool again and let's make a new text box.
02:09This time hold your Mouse button down and drag it out to the right.
02:13This is a great way to create a text box if you need a specific width.
02:17You can just type whatever text you want into the box and it will wrap the text
02:21as needed to keep the width.
02:23If you grab your Arrow tool again, you can click on the edge of the box and
02:26adjust the width if needed and the text will rewrap as necessary.
02:31This next part is fun;
02:32do you remember our hotkey of Q to bring up the Free Transform handles?
02:36When you do this, you can stretch, rotate and skew the text.
02:40You can see that you can work with text in Flash, much like you can in programs
02:44like Adobe Illustrator or InDesign. So let's move on.
02:47We don't need that bottom text box, so let's just delete it.
02:51But let's quickly add a little more text to the other parts of our movie.
02:55Now I'm going to insert keyframe in three spots- Frame 61, Frame 73 and Frame 85 for my project.
03:03Then I'm going to go back and change the phrase that appears in each one
03:07of those keyframes.
03:09Great, you can now drag your mouse across the top of the Timeline where the
03:13numbers are to scrub it and see the effect.
03:16The different phrase appears at each keyframe and stays on the screen for 12 frames each.
03:21Go ahead and test your movie and I think it looks good as the car drives across the stage.
03:27That's all we need to do for the lady and the car.
03:29So let's go ahead and save our file and Close.
Collapse this transcript
Understanding Text Layout Framework (TLF) text
00:00To explore TLF Text, let's go ahead and start a blank FLA file.
00:05Go-ahead and Save the file as TLF.fla anywhere on your computer.
00:14TLF Text stands for Text Layout Framework and basically it offers a lot more
00:19text manipulation methods than Classic Text does.
00:23TLF Text was introduced in Flash CS5 and your end users must have at least Flash
00:28Player 10 for TLF Text to work.
00:31Click on your Text tool and in the Property Inspector if TLF Text is not showing
00:36in the Text type dropdown, select it.
00:39Under the secondary dropdown you can see different types of TLF Text available
00:44and they're different than what the Classic Text options are to.
00:48With TLF Text, you can have Selectable text, which means it appears onscreen and
00:53users can highlight it with their mouse, copy and paste the text into something
00:57like a Microsoft Word document.
00:59You can't do that with Classic Text, which is why it's an option with TLF.
01:03Read Only text is just like it sounds.
01:05It's just read-only.
01:06You can't copy and paste it out of the published SWF file.
01:10Editable text would be the selection you choose if you want someone to be able
01:13to type in their name, email, or other information into your SWF.
01:16Let's choose Read Only, make sure our text box is using Arial Regular font and
01:22choose 10 points and have the Color be black.
01:25Now, let's draw a text box on the stage.
01:31You'll notice your Property Inspector shows you all the different options
01:36that TLF Text gives you.
01:37I'll quickly demonstrate one of these methods now by putting a lot of text into the text box.
01:42To save typing, I am going to copy and paste the first paragraph of text from
01:47the file called TLF.txt, which is sitting in your Exercise Files.
01:59Now, in the Property Inspector, let's open up the area called Container and Flow.
02:03You see a spot here marked Columns.
02:05Let's change this from 1 to 3 and you can see that we now have our text in a
02:10nice three column format.
02:11I am going to expand the text box a little bit, so it's a little easier to see the columns.
02:18In our text box, I am going to add a line break after the existing text and then
02:22paste in our text paragraph again.
02:29You can see that the layout is gone a little bit crazy partially because there's
02:33too much text for the box and this little red square at the bottom right of the
02:37box is an indicator that the text box itself needs to be bigger.
02:41We can hover over that lower right corner of the box and click and drag to make
02:45the box bigger, but instead of just making the box bigger, let's grab our Text
02:49tool again and draw a second TLF Text box below the first one and then a third
02:54one with a more vertical shape to the right.
02:57Then grab your Text tool, select the first text box, and then click on the
03:02little red box at the bottom.
03:04As soon as you move your arrow over the second text box, you'll see this little
03:08icon that looks like a linked chain.
03:10Go ahead and click on the second text box and you'll see that the text now flows
03:14from the first box to the second.
03:15We can do this again by clicking on the little red box at the bottom of the
03:19second text box and then clicking the third text box to flow the text there.
03:25You can continue to play with the layout options for TLF Text to make further
03:29adjustments, but for now, let's test our movie by pressing Ctrl+Enter.
03:37What I want to point out is not the publish SWF.
03:39So, let's go ahead and close that right away.
03:42The thing to note here is the size of the published SWF.
03:44With my Arrow tool, I am going to click on the stage and open up the Properties
03:48Inspector and you can see that we're about 66k.
03:52That's pretty big for something made up of just simple text.
03:55The other thing to know about TLF Text is this.
03:58Go to your file explorer where you saved your Flash file and you'll see a
04:01textLayout.swz file next to your SWF.
04:06TLF Text depends on a specific external ActionScript's library to function
04:11properly and this is it right here.
04:13It's created when you published your SWF.
04:16When a SWF with TLF Text is playing from the Web, it looks for this library in
04:20a couple of places.
04:22First, the SWF looks on the local computer it's playing on where often the
04:26library is cached from previous internet usage.
04:29If the SWF doesn't find it there, it then looks on Adobe.com for the library
04:33file, and if that fails too, then it looks in the same directory as the SWF.
04:38So, to be totally 100% safe when using TLF Text in your Flash movies, you should
04:43be sure this SWZ file is in the same directory on your local computer while
04:48you're developing and then also uploaded to the same directory as your SWF when
04:53you upload it to your Web server.
04:55If you go back to Flash, click on each one of the TLF Text boxes and change
04:59it to Classic Text.
05:14We lose our multiple columns but when we publish again, you can see that the
05:17file size of our SWF is now about 6k.
05:20So, now you have some criteria as to what type of text you should use when
05:26creating Flash movies.
05:28If you need more sophisticated controls for text formatting like multiple
05:31columns or wrapping text, use TLF Text.
05:34Choose Classic Text if you don't need that degree of layout control or need to
05:38be super careful about your published SWF final size.
Collapse this transcript
Embedding fonts
00:00Say you have a text box where the text can be changed during runtime.
00:05For instance, the user can type information in or the text is changed via ActionScript.
00:10There's a technique you need to be aware of.
00:11So please open the file called missingFont.swf in your Exercise Files to
00:17see this in action.
00:18The FLA also exist for your reference but the resulting SWF is what
00:22we're interested in.
00:27This SWF file has input text boxes with text displayed in two fonts, Arial and
00:32Tristan or at least it kind of does.
00:35The first line of text tells you that it's supposed to be displayed in Tristan
00:38font but unless you have Tristan on your computer it's probably not.
00:43For me Flash is substituting Arial instead.
00:46The second line is just in boring old Arial and is probably displaying just fine.
00:50Now, here's why this is happening.
00:52When Flash displays input or dynamic text boxes on the screen, it looks for the
00:57definition of the fonts being used on the end user's local computer.
01:01If it finds those fonts it uses them and the fonts display just fine.
01:06If the fonts aren't found on the user's local computer, Flash substitutes
01:10with something else.
01:11As you can see here, this can lead to some unexpected results.
01:14Now notice the last line of text, which tells you that this is what the font
01:19called Tristan looks like.
01:21You can see what it looks like, because I used a trick to make doubly sure it
01:25would display as Tristan.
01:26I'll demonstrate the trick for you here by opening up a blank FLA file.
01:30I am going to just grab my Text tool and go ahead and type some text on the stage.
01:37Then I am going to go to Modify and Break Apart and then Modify>Break Apart a second time.
01:46Look in the Property Inspector and notice that these are now shapes.
01:50They're just blobs of color that happen to be in the shapes of letters.
01:57So that's what we have in our demonstration SWF.
01:59Letters which look like Tristan but are really shapes.
02:02So, they're not editable like regular text is.
02:04You can go ahead and close the FLA file you just created as well as
02:09the demonstration SWF.
02:14The way to get around this problem is by embedding fonts.
02:17Embedding fonts basically means that you're including, or embedding, the vector
02:21outlines of each character into your SWF file.
02:24This way Flash knows how to draw the characters regardless of what fonts are on
02:27the end user's computer.
02:29As you can see, embedding fonts can be a very worthwhile activity.
02:33So let's learn how to do it by first opening another blank FLA file and then
02:37saving it somewhere on your computer as fonts.fla.
02:40Now, grab your Text tool and choose Classic Text if it's not already chosen.
02:50Under the next dropdown, choose Input Text.
02:53For the font, I am going to choose Berlin Sans FB, but you should pick a font on
02:58your computer that isn't one that everyone would have.
03:00Now, type on the stage a phrase, such as "I need to embed this font."
03:13Let's test our movie by pressing Ctrl+ Enter while it will publish and look just
03:17fine to you because you're using a font on your computer, Flash will give you
03:21an output message stating that Fonts should be embedded for any text that maybe edited at runtime.
03:27The output message is here next to where the Timeline is.
03:31It also encourages you to embed your fonts. So, let's do that.
03:35Close your SWF file if you haven't already and return to Flash.
03:38Grab your Arrow tool and be sure your text box is selected.
03:42Then in the Character area of the Properties panel, click on the button labeled Embed.
03:49The Font Embedding dialog comes up.
03:51Here in the Name area, you can type a more descriptive name than the default
03:55to identify with the font you're embedding is meant to be So, I'll type "Berlin Sans."
04:02Then in the checkbox area, I am going to select to embed the Uppercase,
04:06Lowercase and Punctuation glyphs.
04:09You can also type in any special or unusual characters you want to use in this area.
04:14I'd recommend not selecting all because as you can see that would be 245 glyphs.
04:20You're embedding the vector outline of each glyph into the SWF file, so the
04:24fewer glyphs you embed, the smaller the file size, and the faster the movie
04:27loads for your user.
04:29Once you've made your selections, click OK.
04:31Let's test our movie by pressing Ctrl+ Enter and note that the little reminder to
04:36embed fonts we saw before is gone.
04:38We're set for now but know that if you're using an unusual font in multiple
04:43text boxes in your Flash movie, you need to go through this process for each text box.
04:48Here's an alternative you could use instead of embedding fonts.
04:52Using your Arrow tool, select your text box again and under the font dropdown in
04:56the Property Inspector, scroll to the top and find the top three fonts.
05:01These are device fonts and you'll see out of these three we have Sans,
05:05which looks like Arial, Serif, which looks like Times, and Typewriter,
05:09which looks like Courier.
05:11By using device fonts, you're telling Flash to just pick a font on the user's
05:15local computer that most closely resembles the device font.
05:19By choosing device fonts, you don't have to embed and the SWF size is smaller.
05:24However, since the font outlines are not embedded, expect some variation in what
05:29your end-users will see, since you don't know what font they may have installed
05:33that corresponds to the device font that you chose.
05:36So, now you've seen why and how to embed fonts.
05:39The only thing to remember is that you should embed fonts for text boxes like
05:44input boxes or dynamic boxes that can change during runtime.
05:48You don't have to embed fonts for static text boxes.
Collapse this transcript
8. Incorporating Audio in Flash
Importing and adding audio
00:00Using audio is a great way to help bring your projects to life.
00:03So let's look at how to integrate sound into Flash.
00:06I'm going to open my fastCar.fla file from before.
00:10I'm going to use three different sounds in this project.
00:13One is a background sound when the movie starts; one when the Stop button is
00:16pressed; and the third when the Go button is pressed.
00:20Bringing sounds into Flash is a delightfully easy, one-step process.
00:23You simply import sounds directly into the library.
00:27Let's try it by going to the File menu and choosing Import, then Import to Library.
00:32In the start folder an Exercise Files for this movie, you'll find fastStart.wav.
00:38Flash can import audio in MP3, WAV, AU, AIFF and some other formats as well.
00:48Once you've imported your sound, open your Library panel and you'll see it there.
00:52Click once on fastStart.wav and you'll see a little picture of the waveform
00:56appear at the top of the library.
00:58You can click the tiny Play button at upper right of the Preview panel to hear the sound.
01:02So we've got one out of three sounds ready to go.
01:05Flash comes with a library of free sounds available, so let's grab our
01:09other sounds from there.
01:11Go to the Window menu and then hover over Common Libraries, then choose Sounds.
01:15I'm going to expand this window and as you can see we have a lot of
01:20different choices here.
01:22Let's scroll down until we find the one called Transportation Cars Honda Civics
01:27Start Idle off Mic Under Hood 01.mp3.
01:31Go ahead and click it once to select and you can see we have a little preview
01:35option here as well.
01:36Let's click Play to listen. (clip playing)
01:45Alright it's a loud sound, so we're going to go ahead and stop.
01:48But it's a good one to use.
01:49So let's drag it from the Sounds, over to her FLA document library.
01:54Back in the library, let's double- click on the name and rename it, so
01:57it's easier to read.
01:58How about "startIdle.mp3?"
02:02Back in our Sounds library, scroll up just a little bit and let's preview,
02:06Transportation Auto Avalanche Honk Horn Short 01.mp3.
02:11(clip playing)
02:12That sounds good, so let's drag that over to the Library and rename it as "carStop.mp3."
02:19We can go ahead and close our Sounds Library and let's start by having the
02:23startIdle.mp3 sound play as soon as the movie starts playing.
02:27Make sure all your layers are locked, except for the audio layer.
02:32Then click on the blank Keyframe on frame 1 of the audio layer, so Flash knows
02:37where to start the sound and now simply drag-and-drop startIdle.mp3 from the
02:41library onto the stage.
02:43It may seem counterintuitive to do this, since audio has no
02:46visual representation.
02:48But now we can see the waveform of startIdle. mp3 starting in frame 1 of the audio layer.
02:54Notice two other things as we test our movie.
02:56First, the sound will start up just fine, but it will keep on playing on and on
03:00and on because it's a very loud sound.
03:02Let's go ahead and test our movie. (clip playing)
03:14Close the SWF and then you saw indeed how the very long sound just keeps playing
03:18and playing and playing, even when the playhead goes all the way down to the end
03:21of the movie and starts over at Frame 49.
03:25Let's say we want the sound to stop, when the playhead hits 49, when the little
03:28car first comes onto the screen.
03:31So first I'll show you what doesn't work to fix this.
03:33Let's add a Blank Keyframe to Frame 49.
03:37You'd think that a blank Keyframe would stop the sound, right? Well it doesn't.
03:42If you test the movie even when the playhead gets there, the sound keeps on playing.
03:46(clip playing)
03:53We'll experiment with a more sophisticated way to solve this in the next video.
03:57For now so that idling sound doesn't drive us nuts while we work with our
04:00buttons, we're going to temporarily get rid of it.
04:03Let's do this by clicking on Frame 1 in the Audio layer, opening the Property
04:07inspector and then in the Name drop-down under Sound, let's change this from
04:11startIdle.mp3 to None.
04:14You'll notice that the drop-down lists all of the audio files in the library.
04:18If you're doing something like testing out different audio tracks in a movie,
04:21to see which one works best, this is an easy way to switch out which sound
04:25plays on your Keyframe.
04:27Let's go on to the sounds on the Go and Stop buttons.
04:31Since we want to sound to play whenever someone clicks on the Go button,
04:34let's move our playhead to frame 49 on the Timeline, since that's where the
04:37buttons first appear.
04:39We know that the way you add sound is by dragging and dropping a sound onto the
04:43Timeline where you want it play, so we need to drop it on the Buttons Timeline.
04:48Unlock the layer and then double-click the Go button to enter its timeline.
04:53So far this button only has one layer that has the text Go on it.
04:57Keeping with the best practice of having each item on the Timeline have its own
05:01layer, let's create a new layer in the Timeline and rename it Audio.
05:07We want the sound to play when the user clicks on the button so the place we add
05:11in your keyframe is the down frame.
05:14From here all we have to do is open our library and drag-and-drop the
05:18fastStart.wav file onto the stage.
05:21Let's have our text layer match the audio layer, so right-click on the down
05:26frame, in the text layer and choose Insert Frame or hit F5.
05:30This button is done, so clicks Scene 1 on the upper left to return to the main
05:34Timeline and now let's add sound to Stop button.
05:40Double click the Stop button to enter its Timeline and we're now in edit
05:43in-place mode again.
05:45Just like the last button let's create a new layer in the Timeline and rename it audio.
05:51We want the sound to play when the user clicks on the button, so let's add a new
05:54blank keyframe on the down frame in the audio layer.
05:58Now all we have to do is open our library and drag-and-drop carStop.mp3 onto the stage.
06:05And again, let's have our text layer match the audio layer.
06:09So right-click on the down frame, in the text layer and choose Insert Frame or hit F5.
06:15So we're ready to test our movie.
06:17So we'll just wait through the intro and now we can click each one of the
06:22buttons to hear the sound. (clip playing)
06:27Of course the car doesn't actually start and stop moving yet, but it sure
06:31sounds like it does.
06:32So let's close our test movie and click Scene 1 on the upper left of the screen
06:36to return to the main Timeline.
06:38We're done with the buttons.
06:39Let's just re-add our startIdle sound back into the main Timeline.
06:44Click on the keyframe on Frame 1 of the audio layer and open the Properties panel.
06:48Under the sound area we'll choose startIdle.mp3.
06:52Now we're ready to shorten up that sound in the next video.
06:56But before we do, let's clean up our library a little bit.
06:59Open up your Library panel and let's create a new folder.
07:02Re-name it "Sounds" and let's drag all three of our sounds into the folder.
07:12Now we've seen how to quickly and easily add sound into our Flash movies.
07:16To review the steps first, import the sound into your library.
07:20Then you simply drag-and-drop the sound onto the stage, at the keyframe on the
07:24timeline, you want the sound to start playing.
Collapse this transcript
Working with audio
00:00Sounds that you use in Flash projects sometimes don't behave exactly the way
00:04you'd like him to right off the bat.
00:06So let's look at the options available to you in Flash for controlling and editing audio.
00:11Back in our fastCar.fla file, I'm going to unlock my audio layer and move the
00:16playhead to Frame 1.
00:17The sound we have here is a good one, but there's a little problem in that the
00:21sound file itself is really long.
00:24When you test the movie the sound plays and plays and plays.
00:27Let's just listen to that. (clip playing)
00:36We'd like to have the sound stop by Frame 48, since the scene changes to the
00:41little car driving onto the stage on Frame 49.
00:44We have a blank keyframe on Frame 49, but even that doesn't stop the audio file
00:49from playing on and on and on.
00:51So a good way to solve this problem is by shortening the sound.
00:54We can do this by clicking on the keyframe where the sound begins, so Frame 1 of
00:58the audio layer and opening the Property Inspector.
01:01In the sound area, next to the Effect drop-down find and click on the little
01:06picture of the pencil, to edit the sound.
01:09This brings up what's called the Sound Envelope.
01:12The top track represents the left channel or left speaker or left ear or
01:16however it's easiest for you to think about it and the bottom track represents the right channel.
01:21There's some simple controls for changing your view at the bottom right.
01:25Here you can toggle back and forth between frames in seconds as the unit of measurement.
01:30Using the little slider you can scroll over and see that this sound really is long.
01:34It's about 450 or so frames or almost 38 seconds at our current frame rate.
01:39So I'm going to make sure that I have Frames selected for my view, because I
01:44know I want the sound to end by about Frame 48.
01:46And to cut the sound down, I'm going to grab this little control handle in the
01:51center and move it way over to the left.
01:53You can see Flash cutting off the sound.
01:55Now it would take me forever to slide all the way back to the beginning of the
01:58sound and keep cutting it off.
02:01So I'm going to use the little Zoom tool, down here in the controls, to zoom out
02:04on the sound envelope, so I can cut more off quickly.
02:10Now that I'm down around 50 or 100 frames, I'll zoom in again for more detailed control.
02:15So now I'll slide my little chopper to just before where 48 frames would be
02:22and you can even cut off some of the start of the sound by using the handle bar on the left.
02:27So I'll cut off the left part of the sound track where the sound hasn't really
02:30started out, as well.
02:31Let's click OK to apply our changes and notice how the sound wave on the
02:35Timeline is now shorter.
02:37Let's test our movie by hitting Ctrl+ Enter and indeed our sound is nice and short.
02:41(clip playing)
02:48There's more audio controls available to you and if you'd like to learn more
02:52look at the Flash Essential Training Course for your version of Flash, here in
02:56the lynda.com Online Training Library.
02:59One more thing to note is that if you need to do something more complex
03:03than this to your audio, like maybe combine two different sounds into one audio track.
03:07You'll need to edit your sound file in an outside audio editing software and
03:12then bring the sound into Flash.
03:13A Google search can bring up several free or inexpensive audio editing
03:17programs that you can use.
03:18We're going to test our movie one more time to hear it again, but before we
03:23closed the preview, lets test something else. (clip playing)
03:45You'll notice that this sound can play over the top of itself.
03:48You have multiple instances of the sound playing at the same time.
03:52This could be a cool feature depending on what you're trying to achieve in your movie.
03:56But let's close our test movie and make a quick adjustment so that each
03:59sound can play only once.
04:03The sounds for the buttons are in the timelines of the individual buttons, so
04:06let's unlock our Buttons layer and go to Frame 49 on the Timeline where the
04:11buttons first appear.
04:12Now double-click on the Stop button to enter its Timeline.
04:16Click on the down frame in the audio layer, since that's where the sound is and
04:20now open up your Property Inspector.
04:22The Sync drop-down is where we need to be, it offers you the choices of event,
04:27Start, Stop and Sync.
04:31The default when you drag and drop a sound into your movie is Event.
04:35Sounds with the Event setting, trigger when the playhead enters a keyframe.
04:39The sound plays immediately until it's done, but one instance of the sound can
04:44still be playing when a second is triggered.
04:46That's why our button behaves the way it does now.
04:49For our button sound, we need to choose Start.
04:52Sounds with the Start setting, play only if a previous version of the same
04:56sound has completed.
04:57The Stop setting is pretty obvious, it stops playing a specified sound and the
05:01stream setting causes the Timeline to keep up with the sound.
05:05You'd use this setting in a situation like if you had a long voiceover or
05:08narration and it's important for the sound to sync up with the visuals going on, on the stage.
05:13So there are all our choices, but Start is the one we want to keep.
05:17With that complete, let's click Scene 1 on the upper left to return to the main
05:20Timeline and now double-click on the Go button to enter its Timeline.
05:25We'll do the same thing here as we did for the Stop button.
05:27Click on the down frame of the audio layer, open the Property Inspector and set
05:32this sound Sync to start.
05:34With that let's click Scene 1 to go back to the main timeline again and test the movie.
05:38(clip playing)
05:45Now when you press to Go and Stop buttons multiple times in a row, the sound
05:49has to wait until the first instance is done playing, before it'll play the sound again.
05:54(clip playing)
06:02When you close your preview, lock the audio layer.
06:05So we've seen how to use the Sound Properties dialog box, which you access by
06:11clicking on the sound in the library.
06:13We've also seen how to use the Sync drop-down and Sound Envelope properties
06:17that you access on the keyframe where a sound begins and opening the Property
06:21Inspector.
Collapse this transcript
9. Understanding ActionScript
Linking to an external URL
00:00It's time to make the buttons across the bottom of the fastCar.fla clickable.
00:05So I'm going to have my FLA open, and then move the playhead to Frame 49 with
00:10the Buttons layer unlocked.
00:12We'll start with the Buy Action Figure button at the bottom-right.
00:16When the user clicks this button, they should be taken to a shopping site like
00:20Amazon.com to purchase our fictional fast car action figure.
00:24There are two steps we need to complete to achieve this.
00:28The first is to give the button an instance name, click on the Buy Action Figure
00:32button, and open the Property Inspector.
00:35You can see the very first box at the top has the words Instance name.
00:39Let's type-in here buyBtn, and press Enter.
00:43Take note at the spelling and capitalization that you use here.
00:47The instance name is the hook that ActionScript needs to know which button on
00:51the stage we're trying to control.
00:53We have four different buttons in this project.
00:55So a unique instance name for each one is the only way Flash has to know which
00:59one we're trying to control.
01:01Now, our second step is to add-in the ActionScript that will respond to a
01:04user's button click.
01:06We could type this code in by hand, but Flash CS5 and later has a handy tool
01:11called Code Snippets that can write the code for you.
01:14If you have a previous version of Flash, you can still watch this part and then
01:17just type the few lines of code in by hand.
01:21Make sure the Buy Action Figure button is selected, and then go to the Window
01:25menu, and choose Code Snippets.
01:27Click the arrow next to the Actions folder to expand it.
01:31The action we're going to use is the first one listed, Click to Go to Web Page;
01:36so simply double-click it.
01:38The Actions panel suddenly opens up with the appropriate code written.
01:42I'm going to resize it and then close the side panel, so it's easier to read.
01:47You can see that the first eight lines are grayed out, because they're comments.
01:52The /* on line 1 signifies the start of the comment, and then the */ on line 8
01:58signifies the end of the comment.
02:00ActionScript doesn't execute anything in between those signifiers.
02:04They're just comments.
02:05They're simply for developers to write documentation or instructions for the
02:09code that they've written.
02:10And indeed, you can see that our comments here are telling us what we need to do
02:13to make our code work like we want it to.
02:16The instructions on line 6 tell us to replace www.adobe.com with the desired URL
02:23address, but be sure to keep the quotation marks.
02:26So that's easy enough.
02:27Down here in the actual code, let's replace adobe.com with Amazon.com, or
02:33whatever your favorite online retailer is.
02:36Make sure you keep the quotation marks.
02:38That's all we need to do.
02:39So at this point, let's go ahead and delete our comments, since we'll be adding
02:43more ActionScript for the other buttons later and it'll make it easier to read.
02:47Let's take a quick look at how the code works.
02:50Notice here the name of buyBtn, that's the instance name that we assigned to the
02:55Buy Action Figure button on the stage.
02:58Notice it's using the exact same capitalization and spelling that we typed-in.
03:02If it didn't, this code wouldn't work.
03:04The instance name of the button has to match exactly the instance name typed in the code.
03:10So quickly, what our code here is basically saying is, hey Flash!
03:14Listen for when buyBtn is clicked.
03:17When it is, run this function called fl_clickToGoToWebPage.
03:22The next few lines of code are the actual fl_clickToGoToWebPage function.
03:28
03:28The first line and the opening curly brace start the function and the closing
03:32curly brace ends the function.
03:34The commands in the function tell Flash to open up a browser, and then point the
03:38browser to amazon.com.
03:40If you've written HTML before, the target="_ blank' you see here works in a similar way;
03:46target="_blank' means open up Amazon.com in a new browser window.
03:52Let's call this ActionScript good and close the Actions Panel.
03:55You can X out of it, or you can press F9 to close it.
03:59So where is the code that we just saw located?
04:03Scroll your layers in the timeline up a little bit, and you'll see that Flash
04:06created a new Actions layer for us when we used the Code Snippets tool.
04:12Our playhead was on Frame 49 when we selected the button, and used the Code Snippets.
04:17So Flash made a keyframe on Frame 49, and added our code there.
04:21You can tell this keyframe has ActionScript on it because of the little A that
04:25appears in the frame.
04:26Since we already had an ActionScript layer when we wrote our code before, let's
04:30consolidate our code all onto one layer.
04:33This is easily achieved if you just drag- and-drop the new keyframe down onto the
04:38ActionScript layer like this, and now we can delete the new Actions layer.
04:43To view your code again, simply click on the keyframe and hit F9 on your
04:48keyboard or go to the Windows menu and choose Actions.
04:51You can resize your Actions panel if you'd like.
04:54And by resizing it smaller, I can still see the timeline at the same time.
04:58Now, I'm going to click on Frame 96 to see the code that we wrote there earlier.
05:03Click back on Frame 49 to toggle back-and-forth to the button code.
05:08Go ahead and close your Actions panel and test your movie.
05:11(video playing)
05:15Then, click on your Buy Action Figure button.
05:18A new browser should open up with Amazon.com, or whatever URL you put in your
05:23code already loaded in.
05:26That's all we need to do for this button.
05:28Making any button clickable follows a similar process to what we did here.
05:32Remember that first, the button needs to have an instance name, and then second,
05:36you need to either write code yourself, or use the Code Snippets panel to write
05:40ActionScript to respond to the button click.
05:43Be sure that the instance name in the code matches the instance name you gave
05:47to the button.
Collapse this transcript
Controlling the Timeline
00:01Our fastCar project is almost complete, all that's left is to program the start,
00:05stop, and start over buttons.
00:07Clicking these buttons will make the Timeline and the car stop, play, and start
00:12over at Frame 49, respectively.
00:15We'll add our new code on the same frame as the already existing code for the
00:18buy action figure button.
00:20We can copy and modify the code we've already got.
00:23However, first, remember that for ActionScript to know which buttons we're
00:27trying to control, each one needs to have its own unique instance name.
00:31So with your playhead on Frame 49 and the buttons layer unlocked, click once
00:36on the stop button.
00:37In the Property Inspector type in an Instance name of stopBtn, click once on
00:44the go button, and in the Property Inspector give this button an instance name of goBtn.
00:49Finally, click once on the start over button and give this button an instance
00:54name of the startoverBtn.
00:56Be sure to note the spelling and capitalization you used for each button.
01:00You can even write it down so you're sure to have the exact form at your fingertips.
01:04A quick note about instance names.
01:07An instance name can be almost anything you want, they just can't be a reserved
01:11word in ActionScript like go or stop.
01:14They should not contain any special characters like dollar signs ($) or hash
01:17marks (#), and they can't start with a number.
01:20With our instance name set, let's now write our code.
01:23We'll have the code appear in the same place as the code that controls the buy
01:26action figure button, and that's on Frame 49 of the actions layer.
01:31So select that frame in the Timeline and open your Actions panel by pressing F9
01:36or going to Window and then Actions.
01:38Highlight all of the code we've got so far, Copy it, and then Paste it below the existing code.
01:44The first thing to do is tell Flash what button we want to control by
01:48changing the instance name.
01:50Let's have this be the code for the stop button, so replace where it says byBtn
01:54with the name stopBtn.
01:57Be sure to type it just like you did when you gave the button the instance name.
02:01Okay, so, so far this code is saying, hey, Flash, listen for when stopBtn is
02:08clicked, when it is, run this function called fl_ClickToGoToWebPage.
02:13Well, we've already got an fl_ClickToGoToWebPage function, the buy action
02:18figure button is using it.
02:19So we need to change the name of the function our stop button is running, let's
02:23change this to stop function.
02:25Now, we need to make sure we actually have that stop function defined, so on the
02:30next line change the fl_ClickToGoToWebPage to stopFunction.
02:35Now, what we want the function to actually do is stop the Timeline.
02:39So in the body of the function, between the opening and closing curly braces,
02:44let's replace the existing line of code with a simple stop command stop();.
02:48Please type this exactly as shown, including the parentheses and semicolon.
02:53Now is a good time to test your movie.
03:00And the scene where the lady is driving, click the stop button.
03:06When you do, the playhead on the main Timeline stops.
03:09You can tell because the text at the top where it says she got a brand-new
03:12sports car is holding steady at whatever frame the playhead happened to be on
03:16when you clicked stop.
03:18The car also should stop.
03:19It's a Graphic symbol and so it's affected by what the main Timeline is doing.
03:24The sun you'll notice keeps on growing and shrinking.
03:27If you remember, the sun is a movie clip.
03:29Movie Clip nested timelines run independently of the main Timeline, so it's
03:33behaving differently than the car.
03:35If this isn't working for you as shown, check your spelling and capitalization.
03:40For instance, I'm going to go back to my code and mess up my instance name
03:43from stopBtn to stopbtn, with a lower case b. When I test my movie, right away
03:56I see the Output panel pop-up telling me that on Scene 1, Layer
04:01'actionscript', Frame 49, Line 8, we're trying to access an undefined property
04:06called stopbtn, with a lower case b.
04:11Plus, you'll also notice that the stop button isn't working.
04:14So I'll go back to my code and restore it and the movie will work again.
04:18If you're experiencing difficulty, be sure the instance name you gave your
04:22button and the instance name you're using in your code match exactly.
04:26Another spot to check might be that the function name of stop function is
04:30spelled the same in both places in your ActionScript.
04:34So with our stop button working, let's move on to get the go button working.
04:38Back in your Actions panel, Copy the lines of code that control the stop button
04:42and then Paste them below all the other existing lines of code.
04:47Now we have to modify it.
04:48First off, change the instance name we're looking for from stopBtn to goBtn.
04:54Now, change the name of the function from stopFunction to goFunction in both places.
04:59goFunction is looking pretty good except of course that it's still telling the
05:04Timeline to stop, so let's change our stop to play.
05:09So now our code is currently saying, hey, Flash, listen for when goBtn is
05:14clicked, when it is, run the function called goFunction.
05:17Go ahead and test your movie.
05:23Now, when you click stop, the car stops, and when you click go, it starts up again.
05:30We have one more button to program, the start over button.
05:34This button will start the car over on the right-hand side of the screen.
05:38Basically, we want it to make the playhead start over at Frame 49.
05:42So click on Frame 49 in the actions layer and open up your Actions panel again,
05:47if it's not already open.
05:48Let's Copy our lines of code that affect the go button and paste below all the existing code.
05:55So as before, the first thing to do is specify which button we want to control.
05:59Let's change goBtn to startoverBtn.
06:03Let's change the function now to startoverFunction.
06:12So our startoverFunction needs to send the playhead to Frame 49.
06:16The command we want to use here is gotoAndPlay and 49.
06:21If this looks familiar, it's because this is the exact same line of code
06:24we're also using on Frame 96 of the main Timeline to keep the playhead going
06:29in an infinite loop. Fantastic!
06:31Test your movie and let the lady drive partway across the screen.
06:38Then, click start over to make sure she's being sent back to the right side of
06:42the screen, or rather sending our playhead back to Frame 49.
06:47If it's working correctly, great job, that's quite a bit of ActionScript we've utilized.
06:51If you wish, you can go back to your Actions panel one more time and change some
06:55of the spacing of the lines of code.
06:57I think it's easier to read when the lines of code that are related to each
07:00other are next to each other, and there's a line break between each segment of code.
07:05You can add or delete extra lines as you wish to make it more readable for you. That's it.
07:11Our fastCar movie is complete.
07:13All four buttons are working, each using the principle of having the instance
07:17name of the button match the instance name used in the code.
07:20We've also utilized some additional commands to control the timeline, like
07:24stop, play and gotoAndPlay, all of which will come in handy for you in future
07:29Flash projects.
Collapse this transcript
10. Working with Video
Adding video to the Flash project
00:00Flash is the most common method of delivering video over the web.
00:04Sites like the New York Times and YouTube all rely on Flash to present video.
00:08Adding video to Flash is easy, but before adding it to Flash, the video itself
00:13must first be correctly formatted.
00:15The appropriate video format for Flash is Flash Video, which has an extension of .flv or .f4v.
00:22F4V is a newer Flash video format that supports the H.264 or High
00:30Definition video standard.
00:32Your viewers have to have at least Flash Player 9 to view H.264 video.
00:37So if you already have a video in FLV or F4V format, you're all set and are
00:42ready to use it in your Flash files.
00:44If you have a video that's not in those formats, you're still covered, because
00:48when you purchase Flash Professional, you also get a stand-alone application
00:52called Adobe Media Encoder.
00:54You can use Adobe Media Encoder to convert MOV, MPEGs, AVIs, WMVs, and some
01:01other video file formats into Flash video.
01:04Let's take a quick look at Adobe Media Encoder.
01:06So go ahead and find and open the application on your computer.
01:14Once it's opened, click Add, which looks like a little Plus (+) button to select
01:18what video we want to convert.
01:20Your screen probably looks a little different if you're not using Adobe Media
01:24Encoder for CS5.5 like I am.
01:27But take a look around and you should be able to find the Add button pretty easily.
01:32In the start folder in the Exercise Files for this unit, choose bikes.mov, or
01:37any other video file that you may have and want to use.
01:41Go ahead and select the file and click Open.
01:44And next, you can click the Format dropdown to see the export options we have.
01:47We'll go ahead and stick with FLV.
01:51Under the Preset dropdown, let's select 512x288.
01:55If you're using Adobe Media Encoder CS5, you might like the choice second from
02:00the bottom, which is called Web Medium.
02:02But of course you can pick whichever setting you'd like.
02:05Under Output File, make sure that you like the spot where Media Encoder will put
02:09your converted file.
02:11Having it point to the end folder in the Exercise Files for this chapter
02:15will work just fine.
02:17There's already an FLV there named bikes.flv in case Adobe Media Encoder
02:22isn't working for you.
02:23So you can either overwrite this file or create a new name for the one
02:27you're about to create.
02:29Next, click on the video title once and then go to the Edit Menu, then Export Settings.
02:34Here you can edit the length of your video, resize it, add cue points to it so
02:38it can sync with other things going on, on the screen, affect the quality of the
02:42final output, and more.
02:44We're only going to make one edit.
02:47Here on this Play bar under the video preview we can see that our video is
02:50about 1 minute long.
02:52Let's crop it so it's about 45 seconds long by dragging this white arrow to the
02:56left until we get to about 45 seconds.
02:59It's just before where the bike rider starts talking.
03:04With that, I'll click OK, and then back on the main interface, click Start Cue
03:09to start the conversion.
03:12We can see the progress of the encoder down here in the Current Encode area.
03:17And while this is working, know that the course Publishing Video with the Flash
03:21Platform by Lisa Larson-Kelley here in the lynda.com Online Training Library
03:26will give you excellent detail on all the options, ins and outs of using the
03:30Adobe Media Encoder, much more than the quick glance we took here.
03:34Once the video has done encoding, a green checkmark appears next to the name of
03:38the video, telling us that the video is done processing.
03:41So we're done with the Media Encoder, go ahead and close out, and now go over to
03:45Flash and start a new blank FLA document by clicking ActionScript 3.0.
03:51Save your new file as video.fla.
03:53I'd suggest saving it in the same directory as the FLV video you just converted.
03:58So I'll save mine in the end folder in the Exercise Files for this chapter.
04:03Importing our video from here is easy.
04:05Go to the File Menu and choose Import, then Import Video.
04:10The Flash Video Import Wizard pops up and the first question you're asked is,
04:14where's your video file?
04:16Well, it's on our computer, not already deployed to a Web server somewhere, like
04:20the bottom choice mentions.
04:21So click Browse and navigate to the FLV file you just created.
04:26For the next set of radio buttons, you can choose between Load external video
04:30with playback component or Embed FLV in SWF and play in timeline.
04:35For most cases I would recommend Load external video with playback component.
04:39By choosing this you're telling your FLA file to add a video playback component
04:44with controls like Play, Stop, Pause, Volume Control, etcetera, to the stage.
04:49The video playback component will then point to and play your FLV file, which is
04:53sitting in the directory you just specified.
04:56The FLV video will not actually be embedded into your Flash SWF, it won't appear
05:00in the library, but your SWF will know which video file to play.
05:04This is advantageous because, number one, it's very easy to change what
05:08video you want to play.
05:10You just simply change what FLV video your SWF is pointing to.
05:13You could even create a playlist of videos to loop through.
05:16The second advantage is the file size of the actual FLV video isn't bundled up into your SWF.
05:22If you chose the second option of Embed FLV in SWF and play on timeline, your
05:27FLV is actually physically added onto your timeline and into your library.
05:32If your video file is huge, your SWF file is huge, and it could take a really
05:35long time to download.
05:37Embedding video onto the timeline would be appropriate only in cases such as the
05:41video is very, very short, or if for some reason you want to be able to see what
05:45the video is doing on each and every frame.
05:48With the availability of cue points and other controls that exist for video,
05:52there's really not much reason to ever embed your video onto your timeline.
05:57So moving on, click Next to go to the next screen of the Video Import Wizard.
06:01Here's where you get to choose what that video playback component or video
06:05controls are going to look like.
06:07Take a minute to look through the different options available to you in the
06:10dropdown and what they include.
06:13You can also change the background color of the player component here.
06:16I'm going to choose SkinUnderAllNoVolNoCaptionNoFull and make the Color be gray.
06:24When you're ready, click Next.
06:26The final page is a review page.
06:28Check that the location of the FLV you want to use is correct and note that the
06:32FLV file will be relative to the SWF file when it's all said and done.
06:37The summary says a Flash video component will be created on the stage and
06:40configured for local playback.
06:42Okay, that sounds fine.
06:43And finally, it's telling us that the video component uses a skin file that will
06:48be published next to our FLA when we publish or test our movie, and we'll need
06:52to deploy that to our Web server. All right!
06:55We'll see that file in just a second and it will become more clear what it means.
06:59For now, we're ready, so go ahead and click Finish.
07:02Flash thinks for just a moment and then magically our video component appears on the stage.
07:07You can preview the video, you can play it, pause it, rewind it to the
07:10beginning, turn the volume on and off.
07:21Open your Library and you'll see that all we have in here is an instance of the
07:25FLV playback component, which is the video controller.
07:28Notice that the FLV file itself is not in the library.
07:32We're just pointing the playback component to it.
07:34So go ahead and publish your movie and the SWF file behaves about the same.
07:41But we published for a reason.
07:43Go ahead and close your SWF file and now open your file explorer for your
07:46computer, navigate to the location where your FLA is.
07:50Here you can see the FLA file and the video.swf that you just published.
07:55If you followed the steps in this video, your FLV video is also here.
08:00You'll also note the existence of the SkinUnderAll SWF.
08:05Remember that last line on the video review page that talked about a skin file?
08:09The FLV component can have many different skins, or looks, depending on which one you choose.
08:14And this is what defines it.
08:15The SWF file is used by video.swf to determine how the video playback component looks.
08:22In fact, you can click on the SWF file just to see what it looks like.
08:27When you upload your video.swf file to your website, or wherever it's going to
08:31go, you also need to upload the SkinUnderAll SWF as well.
08:36You also of course need to upload the FLV file.
08:40Back in Flash, say you don't like the layout of your video component anymore and
08:44you want to change it.
08:45Simply click on the playback component on the stage and then open the
08:48Property Inspector.
08:50The Component Parameters area is where all the options are, so find and click on
08:55the little Pencil icon on the line that says skin.
08:58Now you can choose a different skin for the player.
09:00I'll choose the very last option in the list, SkinUnderPlayStopSeekMuteVol and click OK.
09:07You can see that the look of the player updates immediately.
09:11If I publish my movie again and then close the resulting SWF, and now go back to
09:17my file explorer, you'll see that a new SWF file with the corresponding name for
09:21the new skin has been generated.
09:24And if this is going to be your final choice for the skin, then this is the SWF
09:27you'd need to upload to your Web server along with all your other files.
09:31Back to Flash one more time, let's say we want to change what video we're going to play.
09:36Back in the Component Parameters area, click on the little Pencil on the source line.
09:40In the Content Path box, navigate to the Exercise Files for this chapter and
09:45choose the FLV file called surf and click OK.
09:49You've now changed the video that your playback component is pointing to, so go
09:53ahead and test your movie one more time to see the change.
09:58And the video plays.
10:00So we've now seen how to add video into your Flash pieces, so that's the end
10:04of our example here.
10:05When using video, you can have as many other items on your FLA timeline as you wish.
10:11But do follow the best practice of having your video player on its own layer.
10:15Again, if you'd like more detail about using the Flash Media Encoder or more
10:19detail on using the FLV playback component, check out some of the other courses
10:23about Flash video here in the lynda.com Online Training Library, such as
10:28Publishing Video with the Flash Platform by Lisa Larson-Kelley.
Collapse this transcript
11. Publishing a Flash Document
Cleaning up and optimizing files
00:00When getting ready to publish your final SWF files, taking a few minutes to
00:04clean up your FLA and optimizing it can be time well spent.
00:07So it's easy for yourself and your colleagues who might work with the file down
00:10the line to navigate around it.
00:13The first spot to look at is the Library.
00:15Take a look at your library items and delete anything that isn't being used in your movie.
00:20If you're not sure if something's being used, you can go to the Context menu for
00:24the Library here at the upper-right and choose Select Unused Items.
00:28I don't have any here but any of library item not used on the stage at some
00:32point will be highlighted.
00:34Another best practice is to make sure all your Library items are named
00:38something intuitive.
00:39So, when you open the file up maybe three or four months down the line, you can
00:42tell at a glance what each item is.
00:45There's nothing worse than a library full of items named symbol 1, symbol 2, and symbol 3.
00:49Also putting related library items into folders can be helpful.
00:53If you followed along with this course the entire way, we have two Library folders;
00:57Sounds and Buttons.
01:01To optimize your SWF files to be the smallest in file size they can, you can go
01:05through and compress imported audio and images.
01:08For instance, you can double-click on the icon of the speaker for any of your
01:12audio files in the Library and test different output compression settings to get
01:17the right balance of sound quality and file size.
01:20Imported bitmaps can be a big source of file size bloat in your SWFs.
01:25The best way to avoid this is to plan ahead.
01:27Import images only at the dimension and resolution you really need them.
01:31That being said, you can ratchet down the size of your final SWF by affecting
01:35the quality compression Flash uses for images.
01:38To demonstrate this first publish your movie and then close the SWF.
01:42(video playing)
01:46Then look at the SWF History section of the Property Inspector to see the size of our SWF.
01:51You can see that we're at about 132K.
01:55Now in your Library, double-click on the little tree icon next to background.jpg
02:00to open up the Bitmap Properties box.
02:03Using the Quality radio button, you can set a custom progression that Flash
02:07should use instead of the default for your image.
02:10I'm going to be pretty aggressive and use 40%.
02:15Click OK and publish your movie again. (video playing)
02:26The quality of the background image is clearly reduced.
02:29You can see a lot of blockiness, for instance, around the trees at the top.
02:33However, when you close your SWF and look at the SWF History box, you can see
02:37that our file size has been reduced by more than half, down to about 60K.
02:41I'm going to restore my background image to its original settings, but know that
02:46you can play with this to find the right balance between image quality and final
02:50size of the SWF if file size is a concern for you.
02:55If you're building an application like an image gallery that shows a lot of
02:58high-quality images, you might want to keep studying Flash and try techniques
03:03like loading in external images or other assets one-by-one on demand, instead of
03:08embedding them all into a SWF file.
03:10Finally, be careful about the kinds of text you use.
03:13As we discussed in this section about text, embedding fonts and using TLF text
03:18can add significantly to your file size.
03:20So be sure that you need to use these features before incorporating them into
03:24your Flash projects.
03:25With these items considered, we can now publish our final files.
Collapse this transcript
Publishing and deploying files
00:00When publishing for the Web you'll need a SWF file but also an HTML file that
00:05embeds the SWF for display.
00:07Since we're focusing on Web in this course, I won't go over what else you might
00:11need to do if you're targeting Adobe AIR or a mobile platform.
00:15But there are plenty of other courses here in the lynda.com Online Training
00:19Library that address these topics and can help you prepare everything you need.
00:23Let's practice publishing.
00:25With my FLA open, I'm going to go to the File menu and choose Publish Settings.
00:29On the first screen that appears, be sure that the Flash and HTML checkboxes
00:34have both been selected.
00:35On this screen for Flash which is the default view, make sure that the version
00:40of Flash Player you want to target is selected.
00:43For instance I've got Flash Player 10.2. Also make sure the right version of
00:48ActionScript to targeting is selected as well.
00:50We'll leave everything else at the defaults for a quick publish.
00:54On the HTML page we'll leave everything as it is for the moment as well.
00:58Go ahead and click Publish on the bottom and then OK to close the window.
01:02In your file explorer where your FLA received you'll see this SWF and also the
01:07resulting HTML file.
01:09The SWF file is not any different than the SWF you create when you test your
01:13movie during development by pressing Command+ or Ctrl+Enter.
01:17So let's check out the HTML file. Pop it open in a browser and you'll see that
01:22as expected the SWF displays.
01:30Open the HTML file in Dreamweaver or your favorite HTML editor and you'll see
01:34the code that Flash writes for you to embed the SWF into the HTML page.
01:40If the way it is, is fine all you need to do is upload the SWF and HTML file to
01:44your Web server and you're ready to go.
01:46If you want your SWF to appear amongst other content on a webpage you already
01:50have, you'd need to copy and paste the content in between the opening and
01:55closing object tags.
02:01I'm using Flash CS 5.5 for this recording which also uses a DIV and an in-line
02:07style called Flash Content to display the SWF.
02:10So you can copy and paste that as well and modify to suit your needs.
02:14If you're using a different version of Flash what you see in the HTML file here
02:18may be a little different than what I've got.
02:20But the point is that at the bare minimum copying what's in between those object
02:25tags is what's needed to embed this SWF file onto a webpage.
02:28I am going to close my HTML file and go back to Flash.
02:32Now I'm going to open my Publish Settings again and this time on the HTML tab
02:38click the little box next to Detect Flash Version.
02:42What this does is include a little bit of JavaScript that checks to see what
02:46version of the Flash Player your end-user has.
02:49If they don't have the correct version of the player they'll be redirected to go
02:52get it before they can view your content.
02:54I'm going to go ahead and hit Publish and then open up this version of the HTML
02:58page in Dreamweaver.
03:00You'll clearly see the reference to swfobject.js, which is the JavaScript
03:06file we just mentioned.
03:07Look in your file explorer and you'll see it published alongside your SWF and HTML.
03:12If you want to use this you'll, of course, need to upload the js file to your Web
03:16server along with the HTML and SWF.
03:19Our fastCar project doesn't have any other files along with it here, but other
03:23files that your SWF may depend on to function could be FLV or F4V video files,
03:28SWF files that act as the skin definition for the video player as discussed in
03:34the section about video, or SWZ files if you're using TLF text in your SWF.
03:40As you get more advanced in Flash, you may start having directories of images or
03:44text files that your SWF utilizes as well.
03:47The point is, whatever other files your SWF needs to work, be sure to move all of
03:51them up to your Web server for final deployment.
Collapse this transcript
Conclusion
Where to go from here
00:00Thanks for spending these few hours with me.
00:02If you feel comfortable with the topics we've covered, you're now up and running
00:06with Flash, with the toolset needed to utilize animation, timeline control,
00:10video, audio, and a number of other capabilities in Flash.
00:14We went from zero to awesome, pretty quickly.
00:16So if you're ready for more topics and example applications in Flash, there's
00:20plenty at your fingertips here in the lynda.com Online Training Library.
00:24The Flash Essential Training Course for your version of Flash will introduce
00:27even more features, and go into depth on how to use them.
00:31There's also Essential Training for ActionScript courses, as well as titles
00:35focusing on Flash for games, animation, mobile, video, and more.
00:40The sky is the limit,
00:41so enjoy, and I wish you all the best!
Collapse this transcript


Are you sure you want to delete this bookmark?

cancel

Bookmark this Tutorial

Name

Description

{0} characters left

Tags

Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading
cancel

bookmark this course

{0} characters left Separate tags with a space. Use quotes around multi-word tags. Suggested Tags:
loading

Error:

go to playlists »

Create new playlist

name:
description:
save cancel

You must be a lynda.com member to watch this video.

Every course in the lynda.com library contains free videos that let you assess the quality of our tutorials before you subscribe—just click on the blue links to watch them. Become a member to access all 104,069 instructional videos.

get started learn more

If you are already an active lynda.com member, please log in to access the lynda.com library.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Get access to all lynda.com videos

You are currently signed into your admin account, which doesn't let you view lynda.com videos. For full access to the lynda.com library, log in through iplogin.lynda.com, or sign in through your organization's portal. You may also request a user account by calling 1 1 (888) 335-9632 or emailing us at cs@lynda.com.

Access to lynda.com videos

Your organization has a limited access membership to the lynda.com library that allows access to only a specific, limited selection of courses.

You don't have access to this video.

You're logged in as an account administrator, but your membership is not active.

Contact a Training Solutions Advisor at 1 (888) 335-9632.

How to access this video.

If this course is one of your five classes, then your class currently isn't in session.

If you want to watch this video and it is not part of your class, upgrade your membership for unlimited access to the full library of 2,025 courses anytime, anywhere.

learn more upgrade

You can always watch the free content included in every course.

Questions? Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com.

You don't have access to this video.

You're logged in as an account administrator, but your membership is no longer active. You can still access reports and account information.

To reactivate your account, contact a Training Solutions Advisor at 1 1 (888) 335-9632.

Need help accessing this video?

You can't access this video from your master administrator account.

Call Customer Service at 1 1 (888) 335-9632 or email cs@lynda.com for help accessing this video.

preview image of new course page

Try our new course pages

Explore our redesigned course pages, and tell us about your experience.

If you want to switch back to the old view, change your site preferences from the my account menu.

Try the new pages No, thanks

site feedback

Thanks for signing up.

We’ll send you a confirmation email shortly.


By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

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.

By signing up, you’ll receive about four emails per month, including

We’ll only use your email address to send you these mailings.

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked