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

Panning a landscape

From: Flash Professional CS5: Code Snippets and Templates in Depth

Video: Panning a landscape

One of the most popular effects that Flash designers like to incorporate into their presentations is a Panning landscape. An example of this is available in Flash Professional CS5's New File templates in a template named Panning which you'll find in the Sample Files category. I'll create a new file based on this template and then test it. This is a very simple template with three layers, each of which has its own motion tween. The foreground layer shows grass moving at a fast rate, the medium layer shows hills floating by at a slower rate, and the background layer shows clouds moving by at a slow rate.

Panning a landscape

One of the most popular effects that Flash designers like to incorporate into their presentations is a Panning landscape. An example of this is available in Flash Professional CS5's New File templates in a template named Panning which you'll find in the Sample Files category. I'll create a new file based on this template and then test it. This is a very simple template with three layers, each of which has its own motion tween. The foreground layer shows grass moving at a fast rate, the medium layer shows hills floating by at a slower rate, and the background layer shows clouds moving by at a slow rate.

Now, I'll close the test movie and show you how this is architected. There are three layers, each of which contains a movie clip symbol, and a motion tween. The foreground has the grass, the mid ground the hills, and the background the clouds. I am only interested in the clouds for this example, so I'll right-click on the background layer, and select Hide Others, and then right-click again on the background layer and choose Lock Others. That results in selecting everything in the background layer.

Now, I am going to press the Enter key, and show you the animation once, that the clouds move by at a slow rate moving from left to right. I want to use this cloud symbol and the motion tween layer and incorporate all that into my own presentation. So I'll right-click into the background layer, and select Copy Frames, and now the graphic and the motion tween and all the associated frames are in the Clipboard. Then I'll open a file from the Exercise Files area.

The name of the file is logoWithPanning.fla and it's available in the Ch08_SampleFiles folder. I am going to add my clouds symbol into this presentation, but I am going to wrap it in its own movies clip symbol, so that with its own timeline the clouds can move continuously even while the movie's main timeline is static. So I'll go to the Library, right-click on it and choose New Symbol and I'll name the new symbol mcClouds and set its Type as Movie Clip. I'll click OK, then I'll right-click in Frame 1 of the default layer, and paste the copied frames.

Everything about the moving clouds is now inside the Movie Clip symbol. I'll go back to the main Timeline by clicking on Scene 1. I am going to place the clouds into their own layer above the background but behind the sun, hill, bridge, and so on. So I'll right-click on the background layer and choose Insert Layer. I'll double-click on the layer name and name it clouds, I'll right-click on the new layer, and choose Lock Others, and then I'll drag the mcClouds symbol into my new layer.

Now, I am going to drag this symbol down a little bit and then over so that its top-right corner aligns with the top -right corner of the presentation. Then I'll run the movie. You'll see the clouds moving by effectively, but you'll notice that the clouds still flicker, and that's because of the same problem that existed in the New File template, that the state of the graphics at the end of the timeline and at the beginning of the timeline don't match exactly. This is a very common issue when dealing with panning landscapes.

So here are some fixes you can apply. I am going to make some changes to the movie clip symbol, mcClouds. I'll double-click mcClouds in the Library panel, and then in the Timeline, I'll select the first frame. With the first frame selected I'll click on the clouds background and set the X value to -300. That will result in moving the clouds off of the visual screen. When the movie clip starts playing, the clouds will appear for the first time, and then, I'll move the cursor to the end of the timeline at frame number 100.

I'll once again click on the clouds, and I'll set the X position here to 1000, and that moves the clouds entirely off the screen. I'll go back to Scene 1, and I'll play the movie. The result of this is that the clouds are moving much faster, but you'll also see that the clouds aren't broken up or spliced during the playing of the movie. There is one last problem to solve though, and that's the entire image is moving off the screen, showing the white background of the movie.

So here's the final step to fix it. I'll close the test movie, and then go to Modify > Document. I'll set the background color of the document to the same color that contains the clouds. I'll click on the color selector and then drag the eyedrop down to the cloud color, and release, and click OK. Now, the document background exactly matches the color of the sky that's incorporated into the cloud image. I'll run the presentation again and here is the result.

The clouds are moving cleanly across the screen. There doesn't seem to be any perceptible break in the animation because I am allowing the beginning and ending of the movie to not have any clouds at all. To slow down the clouds, you would go into the movie clip symbol, and expand the size of the motion tween, slowing down the internal animation of the movie clip symbol, but you wouldn't have to do anything to the main timeline because it only contains a single frame, and in that frame you have a single instance of the mcClouds movie clip symbol, which is doing the animation.

So this is a great example of how you can learn the best techniques for accomplishing basic effects using the New File templates. Then with a little bit of creative copying and pasting and minor modifications to the document and its movie clip symbols, you can incorporate those effects into your own Flash movies.

Show transcript

This video is part of

Expand all | Collapse all
  1. 4m 40s
    1. Welcome
      1m 32s
    2. Understanding the prerequisites
      1m 42s
    3. Using the exercise files
      1m 26s
  2. 39m 39s
    1. Using code snippets
      4m 7s
    2. Touring the Code Snippets panel
      2m 51s
    3. Adding a simple code snippet
      3m 28s
    4. Adding a complex code snippet
      7m 45s
    5. Applying code snippets to movie clip instances
      5m 25s
    6. Showing and hiding movie clip instances
      3m 20s
    7. Handling common mouse events
      8m 1s
    8. Handling keyboard events
      4m 42s
  3. 36m 21s
    1. Adding Play and Stop actions
      5m 27s
    2. Handling the enterFrame event
      8m 5s
    3. Managing multi-scene presentations
      8m 14s
    4. Adding drag and drop
      6m 33s
    5. Rotating objects
      5m 5s
    6. Fading objects
      2m 57s
  4. 27m 14s
    1. Starting and stopping sounds
      7m 24s
    2. Showing video with FLV Player and ActionScript
      5m 15s
    3. Showing video with NetStream
      4m 19s
    4. Stopping, pausing, and resuming video
      5m 19s
    5. Seeking a cue point
      4m 57s
  5. 22m 49s
    1. Loading external SWF files
      4m 50s
    2. Adding library symbol instances to the Stage
      6m 40s
    3. Loading external images
      7m 26s
    4. Loading external text
      3m 53s
  6. 14m 36s
    1. Exploring the Code Snippets XML file
      4m 12s
    2. Modifying an existing code snippet
      3m 0s
    3. Adding a custom code snippet
      3m 41s
    4. Managing code snippet categories
      3m 43s
  7. 36m 5s
    1. Understanding template types and categories
      4m 33s
    2. Creating clickable advertising presentations
      6m 10s
    3. Reusing movie clip symbols from templates
      6m 10s
    4. Replacing content in a new file template
      6m 56s
    5. Randomizing movement in movie clip symbols
      6m 1s
    6. Scripting movement in animations
      6m 15s
  8. 18m 50s
    1. Creating a photo album
      4m 38s
    2. Creating a simple slideshow presentation
      4m 13s
    3. Creating an advanced slideshow presentation
      5m 35s
    4. Creating a desktop slideshow with Adobe AIR
      4m 24s
  9. 18m 45s
    1. Counting down dates
      3m 38s
    2. Panning a landscape
      5m 51s
    3. Revealing text with masks
      3m 48s
    4. Animating with inverse kinematics and bones
      5m 28s
  10. 42s
    1. Goodbye
      42s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Flash Professional CS5: Code Snippets and Templates in Depth.

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


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

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

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

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

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.