Ok, people have been mailing me and messaging me about certain action script questions, so I thought I'd answer some of them, plus a little more:
BASICS(1)
December 7th, 2002. 5:03 PM.
Prefixes:
_root. This is used to target a shape or movie clip. This really is locating the shape/MC, wherever it may be. _level0,1,2,3 may be used also, because this determines the level of where the MC/shape is.
Example: _root.mc1.play();
_parent. This is used to target a shape or a movie clip from INSIDE a movie clip.
Example: _parent._root.mc1.play();
_visible = x; Determines if the object is visible or not. "x" equals "True" or "False."
Example: _root.mc1._visible = false; (The object is invisble.)
_level(x) Like _root., but is more confusing...You must determine what "Level" the object is on. "x" should be replaced by the level, with no () around it.
_alpha = x; Used to determine the transparency of objects.
Example: _root.mc1._alpha = 30;. (This will produce a medium transparency.)
_x In terms of the x axis. (Left and right)"+" would be going right, and "-" would be going left.
Example: _root.mc1._x+=5;. (This moves the MC 5 places to the right every second.)
_y See "x".
Example: _root.mc1._y+=5;
_rotation Rotates an object with no frames required.
Example: _root.mc1._rotation+5;. (This will rotate the object to the right quite slowly.
_xscale Shrinks or enlarges a shape or movie clip, to the "X" axis.
Example: _root.mc1._xscale+=5;.
_yscale See "xscale".
Example: _root.mc1._yscale+=5;
Controllers:
Controllers are action script statements that set up variables, that can be reffered to. In English, you can set up a statement saying:
if(key.isDown(key.LEFT))
{//action goes here
}
That says, if the key is down, Left, the action will take place. Without controllers, there is no way to activate an action.
if(condition) {action} Sets up an "if" statement, which tests if something is happening. If it is, the action will take place.
Example:
if(key.isDown(key.LEFT)) {
_root.mc1._x-=5;
}
}Else{
Used to see if an action is NOT happening. Used in an "if" statement.
Example:
if(key.isDown(key.LEFT)) {
_root.mc1.play();
} else {
doNothing();
}
| » Level Basic |
|
Added: 2003-02-10 Rating: 7 Votes: 37 |
| » Author |
| Information provided by myself. Heh hehe. |
| » Download |
| Download the files used in this tutorial. |
| Download (0 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!