Post by Ashley Hall on May 25, 2005 19:13:45 GMT 10
Okay, im gonna tell everyone some basic actionscript .
Note - things inbetween * are comments
These are used on movieclips (MC)
onClipEvent(stuff)
Something that happens to a movieclip
The list of things you can do to a movieclip (inside brackets) They are:
load - The action is used when the MC is first loaded (put in the timeline)
unload - The action is used in the first frame after the movieclip is removed from the timeline
enterFrame - The action is used continually at the frame rate of the movie
mouseMove - The action is used whenever the mouse is moved
mouseDown - The action is used when the left mouse button is pressed
mouseUp - The action is used when the left mouse button is released
keyDown - The action is used when a key is pressed. Use Key.getCode() to retrieve information about the last key pressed. (dont ask)
keyUp - The action is used when a key is released. Use the Key.getCode() method to retrieve information about the last key pressed. (yet again dont ask)
data - The action is used when data is received in a loadVariables() or loadMovie() action. (thats really advanced)
I'd recommend just using load and enterFrame for starters.[/color]
Now for some other stuff
this._x means the x (left and right) coordinates of this MC
this._y means the y (up and down) coordinates of this MC
You can change the coordinates by saying things like:
this._x +=50;
*or*
this._x -=50;
that means that the x coordinates of the MC are whatever they are now plus/minus 50.
this._x ++;
*or*
this._x--;
that means that the x coordinates of the MC are one higher/lower than before
You can change the x for y to alter the y coordinates.
If you want to change the properties of something else (not "this") you have to give the thing you want to change a name. (i hope you got that)
First select the MC the properties changed of and go to properties, change the instance to something that you will remember.
Now go to the MC you want to control it and select the actionscript box. type in something like:
onClipEvent(enterFrame){
_root.yourmc._x +=50;
}
That should change the MC "yourmc"s x coordinates plus 50. You have to change the name "yourmc" to whatever you named the other MC.
I hope that made things a whole of a lot clearer for you. For more info, add me to MSN ash_man_04@hotmail.com
If you don't have a hotmail account, go to
www.hotmail.com/ and sign up.
Note - things inbetween * are comments
These are used on movieclips (MC)
onClipEvent(stuff)
Something that happens to a movieclip
The list of things you can do to a movieclip (inside brackets) They are:
load - The action is used when the MC is first loaded (put in the timeline)
unload - The action is used in the first frame after the movieclip is removed from the timeline
enterFrame - The action is used continually at the frame rate of the movie
mouseMove - The action is used whenever the mouse is moved
mouseDown - The action is used when the left mouse button is pressed
mouseUp - The action is used when the left mouse button is released
keyDown - The action is used when a key is pressed. Use Key.getCode() to retrieve information about the last key pressed. (dont ask)
keyUp - The action is used when a key is released. Use the Key.getCode() method to retrieve information about the last key pressed. (yet again dont ask)
data - The action is used when data is received in a loadVariables() or loadMovie() action. (thats really advanced)
I'd recommend just using load and enterFrame for starters.[/color]
Now for some other stuff
this._x means the x (left and right) coordinates of this MC
this._y means the y (up and down) coordinates of this MC
You can change the coordinates by saying things like:
this._x +=50;
*or*
this._x -=50;
that means that the x coordinates of the MC are whatever they are now plus/minus 50.
this._x ++;
*or*
this._x--;
that means that the x coordinates of the MC are one higher/lower than before
You can change the x for y to alter the y coordinates.
If you want to change the properties of something else (not "this") you have to give the thing you want to change a name. (i hope you got that)
First select the MC the properties changed of and go to properties, change the instance to something that you will remember.
Now go to the MC you want to control it and select the actionscript box. type in something like:
onClipEvent(enterFrame){
_root.yourmc._x +=50;
}
That should change the MC "yourmc"s x coordinates plus 50. You have to change the name "yourmc" to whatever you named the other MC.
I hope that made things a whole of a lot clearer for you. For more info, add me to MSN ash_man_04@hotmail.com
If you don't have a hotmail account, go to
www.hotmail.com/ and sign up.