Now that you have a sense of what a Movie Clip can do (or be told to do), let’s get some practical experience with the Movie Clip properties. This section shows you how to access Movie Clip appearance properties that control position, scale, and rotation.
Positioning Movie Clips
You can change the location of Movie Clip instances on-the-fly with position properties such as _x and _y. How is this useful? If you want to create multiple Movie Clip instances that move randomly (or predictively) across the Stage, then you can save yourself the trouble of manually tweening them by writing a few lines of Action- Script code on the object instance:
How does this code work? In step 3, you specified that the onClipEvent (enterFrame) handler should be assigned to the Movie Clip instance. Because this particular Movie Clip has only one frame (with no stop() action in it), the enterFrame event is triggered continuously. Therefore, any actions nested within the handler will be executed repeatedly.
Our nest contains one action: this._x += 5. On the left side of the action, this refers to the object instance to which this handler and code has been applied. In our case, this refers to our circle Movie Clip instance. Immediately after this is the property for X position, _x. By adding the property _x to the object this, Flash knows that we want to change the value of this property.
On the right side of the action are the operators += and the value 5. By combining the + and = operators, we’ve created a shortcut to adding the value of 5 to the current X position of the circle Movie Clip instance. Each time the enterFrame event occurs, the circle Object moves 5 pixels to the right.
To show how quickly you can replicate this action on multiple Movie Clips, select the instance of the circle Movie Clip on the Stage, and duplicate it (Ctrl+D or Command+D) as many times as you wish. When you test your movie, each instance moves independently across the Stage.
Scaling Movie Clips
In the last example, you learned how to access the _x and _y properties of the Movie Clip Object. The next example shows you how to use a Button symbol to enlarge or reduce the size of a Movie Clip on the Stage.
This code uses the with() function to target the circle Movie Clip instance with a nested group of actions. In this case, we’ve increased the values of the _xscale and _yscale properties by 10 percent. With each release event on the Button symbol, the scale properties of the circle instance will be changed.
By changing the += operator to -=, each click on this Button instance will reduce (shrink) the circle Movie Clip instance by 10 percent.
Rotating Movie Clips
Let’s move along to the rotation property, _rotation, which is used to control the angle at which our Movie Clip is shown. In this sample, we’ll use the same .FLA file that we created in the previous section.
Flash Related Interview Questions
|Adv Java Interview Questions||J2EE Interview Questions|
|Adobe Flex 3 Interview Questions||Dreamweaver Interview Questions|
|3D Animation Interview Questions||Adobe Flash CS6 Interview Questions|
|Dreamweaver CS3 Interview Questions||Adobe Flex Interview Questions|
|Adobe Flex Actionscript Interview Questions||Gif Animation Interview Questions|
|Adobe Fireworks Interview Questions|
Understanding The Flash Framework
Exploring The Interface: Panels, Settings, And More
Using Tools For Navigation And Viewing
Working With Selections And The Pen Tool
Working With The Drawing And Painting Tools
Working With Text
Exploring The Timeline
Checking Out The Library: Symbols And Instances
Drawing In Flash
Animating In Flash
Using Bitmaps And Other Media With Flash
Designing Interfaces And Interface Elements
Understanding Sound For Flash
Importing And Editing Sounds In Flash
Optimizing Flash Sound For Export
Understanding Actions And Event Handlers
Navigating Flash Timelines
Controlling Movie Clips
Sharing And Loading Assets
Planning Code Structures
Creating Subroutines And Manipulating Data
Understanding Movie Clips As Complex Objects
Sending Data In And Out Of Flash
Understanding Html And Text Field Functions In Flash
What Is Generator?
Revving Up Generator
Working With Third-party, Server-side Applications
Working With Raster Graphics
Working With Vector Graphics
Working With Audio Applications
Working With 3d Graphics
Working With Quicktime
Working With Realplayer
Creating Full-motion Video With Flash
Creating Cartoon Animation With Flash
Planning Flash Production With Flowcharting Software
Working With Authoring Applications
Publishing Flash Movies
Integrating Flash Content With Html
Using Players, Projectors, And Screensaver Utilities
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.