Controlling Movie Clip Properties with ActionScript 3.0
Controlling Movie Clip Properties with ActionScript 3.0
Most Flash designers are used to working with movie clip symbols in the Flash interface. But nearly all the features that can be accomplished with movie clips in the Flash interface can also be controlled with ActionScript. You can even create new movie clips from scratch with ActionScriptvideo tutorials. This article shows how to change some basic MovieClip properties with ActionScript.
NOTE
This article is adapted from ActionScript 3.0 for Adobe Flash CS4 Professional Classroom in a Book. Copyright 2009. Used with permission of Pearson Education, Inc. and Adobe Pressvideo tutorials.
Changing a Property Value
The basic syntax to change any property of a MovieClip is to type the clip's instance name, followed by a period (.), the property name that you want to change, an equals sign (=), and then the new value:
movieClipInstanceName.propertyName = value;
For example, if you have a MovieClip with an instance name of clip1 and you want to rotate it 90 degrees, the code would read this way:
Clip1.rotation = 90;
If you know the possible properties that you can control and their range of values, this simple technique can accomplish quite a bit.
The following table contains a few of the most common properties and their ranges. For the full range of properties and values, see Flash CS4 Helpvideo tutorials.
Property
Values
Description
x
infinity to +infinity
Horizontal position
y
infinity to +infinity
Vertical position
rotation
180 to 180 (degrees)
Rotation
alpha
0 to 1 (0 = transparent, 1 = opaque)
Transparency
scaleX
infinity to +infinity
Horizontal scale
scaleY
infinity to +infinity
Vertical scale
visible
true (visible) or false (invisible)
Visibility
NOTE
For the rotation property, you can use any numbers, but ActionScript will convert them to the range between 180 and +180 degrees.
The Flash stage is measured from the upper-left corner. A movie clip with an x position of 0 means that the registration point of the clip is on the exact left of the stage. A position of 0 for the y value means that the clip is at the top of the stage. Values greater than zero for x and y refer to positions to the right and down, respectively. Negative x and y values indicate positions offstage to the left and above the stage.
Commercial properties in Dubai and Bahrain Get the most beneficial Residential properties in Dubai Lucrative Possibilities of Leasing Properties Metaphysical Healing Properties of Crystal Spheres, Wands, Blades and Points The Properties of Acrylic Know More On How To Manage Your Entire Properties While Facing Foreclosure In Las Vegas How Impacted Investors Compare Properties In Las Vegas Potential Understanding Rental Properties Capitalization Rate Get High Value With Indian Properties Leaseback Properties: Generating Extra income with Some of the Best Investments How To Tell Whether GA Apartments For Rent Or Other Rental Properties Are Right For You Shield your properties from harsh weather and rain with excellent wall coatings Using An Atlanta Property Locator To Find Rental Properties While On Out-Of-State Assignments
www.yloan.com
guest:
register
|
login
|
search
IP(216.73.216.140) California / Anaheim
Processed in 0.015047 second(s), 7 queries
,
Gzip enabled
, discuz 5.5 through PHP 8.3.9 ,
debug code: 74 , 2647, 340,