logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
European Travel
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel


dailyclick
All times in EST

Autism Spectrum Disorders: 4:00 PM

Full Schedule
g
g Flash and Animation Site

BellaOnline's Flash and Animation Editor

g

Flash CS3 TransitionManager.start() Method


Now that we have examined the various transitions in the fl.transitions package for FlashR CS3, it's time to take a look at the code that runs these effects. The most common way to run these effects is with the TransitionManager.start() method which creates a TransitionManager instance, applies the transition effect to the object of your choice and starts the transition. This method has several parameters which you can set to control the effect. Here is the basic code.

import fl.transitions.*;
import fl.transitions.easing.*;

// apply transition
TransitionManager.start(name_of_object, {type:name_of_effect, direction:Transition.IN, duration:5, easing:None.easeNone});

As you can see, the code begins with TransitionManager.start(). Inside the parentheses are the parameters. The first parameter is the content parameter which tells Flash the name of the object that you wish to apply the effect to. Let's use the same photo that I used when I made the examples. We will set the content parameter to "photo_mc". But, first we need to import the photo and convert it to a movie clip, which we will call "photo". Then, we will give the movie clip the instance name of "photo_mc".

TransitionManager.start(photo_mc, {type:name_of_effect, direction:Transition.IN, duration:5, easing:None.easeNone});

After the comma, we have more parameters between curly brackets but still within the parentheses. These parameters are called transParams parameters and are used for any of the transition effects. They are the type, direction, duration and easing parameters. You will set the type parameter to the name of the transition effect class you wish to use. Let's set this to the Fade transition and set the rest of the parameters to the following, which will set the direction inward, the duration to 5 seconds and no easing.

type Fade
direction Transition.IN
duration 5
easing None.easeNone

The code for the Fade transition will look like this.

TransitionManager.start(photo_mc, {type:Fade, direction:Transition.IN, duration:5, easing:None.easeNone});

Other transitions that can use this same code are the Photo and Zoom effects. You only need to change the content parameter to the effect you wish to use.

TransitionManager.start(photo_mc, {type:Photo, direction:Transition.IN, duration:5, easing:None.easeNone});

TransitionManager.start(photo_mc, {type:Zoom, direction:Transition.IN, duration:5, easing:None.easeNone});

The rest of the transitions take a little more coding with the addition of the transition effect class parameters. We will discuss these in the next lesson.

Join us in the Flash forum.




Add Flash+CS3+TransitionManager%2Estart%28%29+Method to Twitter Add Flash+CS3+TransitionManager%2Estart%28%29+Method to Facebook Add Flash+CS3+TransitionManager%2Estart%28%29+Method to MySpace Add Flash+CS3+TransitionManager%2Estart%28%29+Method to Del.icio.us Digg Flash+CS3+TransitionManager%2Estart%28%29+Method Add Flash+CS3+TransitionManager%2Estart%28%29+Method to Yahoo My Web Add Flash+CS3+TransitionManager%2Estart%28%29+Method to Google Bookmarks Add Flash+CS3+TransitionManager%2Estart%28%29+Method to Stumbleupon Add Flash+CS3+TransitionManager%2Estart%28%29+Method to Reddit



 



RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the Flash and Animation Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Diane Cipollo for details.

g


g features
Animation Behaviors in Motion Project

Importing Photoshop Images into Motion

Motion 3D Animation - The Graphics

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor