Actionscript
3.0 Lesson Seven: Basic Properties
1.)
Changing a MovieClip size, alpha, visibility, or placement
is quite easy in flash. I will proved in an example
in the code below, but first you need to make a Movie
Clip and give it an instance name of myMovieClip and
place it on the stage. You can test this by placing
the code inside a flash actionscript document's frame.
|
---------
--------------
---------
--------------
|
2.)
Here is the code;
myMovieClip.x
= 75;
myMovieClip.y = 400;
myMovieClip.alpha = .50;
myMovieClip.scaleY = 2;
//these lines of code are done by percentages of 0.1
to 1, or you can change it to double the side etc...
by increasing to to 2 myMovieClip.scaleX = .5; //these
lines of code are done by percentages of 0.1 to 1, or
you can change it to double the side etc... by increasing
to to 2 myMovieClip.visible = true;
The Breakdown. You can add properties to your Movie
Clip or any variable by adding a dot action, and placing
the propery after the dot. You can also edit them inside
any kind of funtion, such as a for function or a if
statement. I will provide an example
var myFunction:function();
myFunction(){
while(true){
myMovieClip.alpha--;
}
}
|
-jordan |
|