@5:/\/\@1|\|!!!!1111
________________
In this tutorial,you will learn a bunch of basic stuff like variables and stop(); actions without to much moving around and asking!Let's start.I'll just go down a list and tell you what each action does.

Timeline Control

gotoAndPlay(#); - gotoAndPlay is used in both buttons to go to certain places and used in frames to go to certain frames.Some people are to lazy to click buttons you know :)

EXAMPLE
on(press){
gotoAndPlay(1);
}

This can be used as a simple 'replay' button in Flash.

EXAMPLE 2
gotoAndPlay(1);

Goes to a certain frame without the use of a button.

Where the number '1' is,you can change to whatever to go to whatever frame you want.

During gotoAndPlay,we're led into the _root. function.You may be trying to use a gotoAndPlay() in a movieclip and find that the button/frame won't do anything but change some stuff.This is where _root. comes in(or _parent).The _root function simply uses something like rooting into something or something...I actually don't know,but it's really easy to use.You can use it to change movieclips or the main timeline from in a movieclip.You can use the _root. function in almost every line of script.

EXAMPLE
on(press){
_root.gotoAndPlay(1);
}

Not to hard :)

EXAMPLE 2
_root.gotoAndPlay(1);

Same thing but inside a frame.

gotoAndStop(#); - Everything with this is the same as gotoAndPlay,except for it stops the main timeline/movieclip instead of letting it keep playing.I usually use this in my codes or for maybe a button.

EXAMPLE
_root.gotoAndStop(1);

This will stop the movie on whichever frame chosen.

EXAMPLE 2
on(press){
_root.gotoAndStop(1);
}

This will stop the frame on whichever frame is chosen after pressing a button.

nextFrame(); - This is a really simple thing.It just goes to the next frame.The cool thing about this specific code,however,is that it can be used as a fast-forward button.

EXAMPLE
on(press){
_root.nextFrame();
}

The 'press' function for the button must be used for this to work.

prevFrame(); - Same thing as the nextFrame,except is goes to the previous frame.It can be used as a rewind button.

EXAMPLE
on(press){
_root.prevFrame();
}

play(); - This is for a simple 'play' button.It can also be used in frames in a movieclip or something.

EXAMPLE
on(press){
_root.play();
}

Simply 'play's your movie.

EXAMPLE 2
_root.play();

Starts playing the movie automatically with no buttons.

nextScene(); - This can be used in a button to get to the next scene.I'm not sure if anyone uses it in the timeline though.It could probably be used as a fast-forward through scenes(aka nextScene button).

EXAMPLE
on(press){
_root.nextScene();
}

Simply goes to the next scene.Change 'press' to 'release' if you want to keep people from a fast-forward.

EXAMPLE 2
_root.nextScene();

Goes to the next scene from a frame in the timeline.

prevScene(); - The same as 'nextScene',just backwards.

EXAMPLE
on(press){
_root.prevScene();
}

Used in a button to go to the previous scene.

EXAMPLE 2
_root.prevScene();

Goes to the previous scene from a frame in the main timeline.Could probably be used for a never ending cartoon(endless loop,just like "Triangles vs. Squares".

stop(); - The name says it alls.This code stops the movie during the timeline.It can be used in buttons and on the main timeline very easily.

EXAMPLE
on(press){
_root.stop();
}

Stops the movie on a button press.Used in movie control a lot.

EXAMPLE 2
root.stop();

Stops the timeline without the use of a button.Used on preloader screens,menu screens,and replay screens a lot.

stopAllSounds(); - This stops all the sounds playing(event started sounds).I usually never use this anymore.It's always used to stop music at the end of a movie or something like that.A lot of movies have event looping clips(short loops from Flashkit or something).Then again,a lot of movies stream the music.It doesn't matter,stopAllSounds(); just stops event clips in my mind.

EXAMPLE
on(press){
stopAllSounds();
}

This will stopAllSounds(); on the press of a button.Notice how _root. isn't there?It isn't needed.

EXAMPLE 2
stopAllSounds();

Really simple.Just stops the sounds on a keyframe.

That ends all I have to say about the main timeline.It should be clear enough now,right?

Continued-Starting API
____________________
(NOTE:All codes are made in the Action Script menu,press F9 on your keyboard to open it up)

I'm not one that could do to much with API,but I know I could explain the basic parts of it.This post might be short,but whatever.

Explaining API:API is mostly something people use to make KB games,which is trying to keep the KB file size low,which means that they don't use anything but coding,which is API.API can never be animated into a good full length movie(well,good that is...the longest your movie would be is less than 1 second)and is always used for games...most of the time.

(copy+paste into first movie frame)-I know it's not a box even though it should be,but it doesn't matter.It's an API code.Lemme explain each code as best I can.

createEmptyMovieClip("t",2) - This creates the movieclip item.It also must start any code that you make in API,otherwise nothing happens.Where "t" is at is the name of the movieclip.In almost all API games,there are at least 2 empty movie clips.Name them well.2 is the depth of the object.I really don't know what this is for,so I just put 2 or 5 in.

lineStyle(5, 000000, 100) - This is creating the lineStyle of you object.The first number is the size of your line(0-10.This is your chance to see what a 100 sized line is like),the second number(or 6 numbers) is the RBG or RGB,whatever is is.When choosing a color for something,a fill,you'll notice the numbers at the top of the fill box(or line box).That 6 part number the RBG.000000 is black,FFFFFF is white,FF0000 is red.There are endless numbers.I usually use black for lines...ok,the last number is the alpha of the line.100 will make the object solid,any lower will make the object start disappearing.

beginFill(0xFF0000, 100) - This,as the code part says,is beginning the fill...as in fills in the object you make with a color.The first number,once again,is the RBG.notice how I added 0x before the number?I dunno if it's needed,but I had to to make the fill appear.The second number...(sigh)...is the alpha.Change it lower to make the object start disappearing.

lineTo(50, 0) - This is the part where your shape will start taking form.The first number is the X value of where the X line goes to.The second number is the same,but deals with Y.

EXAMPLE
lineTo(0, 50);
lineTo(50, 0);
lineTo(50, 50);
lineTo(0, 0);

This should make a square,but it isn't working,so instead you come out with a butterfly or something...REMEMBER that your object will always start in the top left hand corner.

endFill() - Simple.This will end the first object you make.A better way to say it is \it separates this objects edits from the other objects/

Now,this next part can be done 2 ways...it's for moving your object to where you want it at.

FIRST WAY
The first way you can do with is by using the moveTo code or whatever.

moveTo(0, 0) - This is sorta like lineTo,but instead,it moves the object to the X and Y value places.The first number is for moving the object to a selected X place,and the second number is moving it to the Y place.

Notice how the object moved close to the center of the stage or something?I like to use this way better.

I know there are more ways to use API,but I can't figure any of them out.

Final note:With API,you can create platforms and stuff without to much trouble.It's mostly just adding the script to the objects edit and changing it a bit to make it work.When making a platform,however,you need to make another movieclip to be the platform.

Well,that's all!(I'll post a new post for helping out in a bit day or 2...or more)

The actual type is 'Object -> Number', the first argument being either a string (for scenes, requires the second parameter) or a number (for the current scene). 'Object' is the base class of AS and any other type is a subclass to it.